Lines Matching refs:encode
127 body = self.headers['x-special-incoming'].encode('utf-8')
267 self.assertEqual(res.read(), 'Ärger mit Unicode'.encode('utf-8'))
435 .encode(enc, 'surrogateescape'), body)
437 .encode(enc, 'surrogateescape'), body)
445 self.assertRegex(response, f'listing for {self.base_url}/\?x=123'.encode('latin1'))
448 self.assertRegex(response, f'listing for {self.base_url}/\?x=\xef\xbf\xbd'.encode('latin1'))
641 self.assertIn(html_text.encode(enc), body)
689 k.encode('ascii')
690 v.encode('ascii')
704 linesep = os.linesep.encode('ascii')
740 self.pythonexe.encode('utf-8')
949 expected = f"HTTP_ACCEPT={expected}".encode('ascii')
1220 self.assertIn(html.escape(text, quote=False).encode('ascii'), result)