Lines Matching full:encode
35 self.assertEqual(u''.encode(enc), '')
39 self.assertEqual('abcd'.encode(enc), 'abcd')
66 self.assertEqual(encoder.encode(u'\ud30c\uc774\uc36c \ub9c8\uc744'),
69 self.assertEqual(encoder.encode(u'\u2606\u223c\u2606', True),
72 self.assertEqual(encoder.encode(u'', True), '')
73 self.assertEqual(encoder.encode(u'', False), '')
83 self.assertEqual(encoder.encode(u'\u00e6\u0300'), '\xab\xc4')
84 self.assertEqual(encoder.encode(u'\u00e6'), '')
85 self.assertEqual(encoder.encode(u'\u0300'), '\xab\xc4')
86 self.assertEqual(encoder.encode(u'\u00e6', True), '\xa9\xdc')
89 self.assertEqual(encoder.encode(u'\u0300'), '\xab\xdc')
91 self.assertEqual(encoder.encode(u'\u00e6'), '')
92 self.assertEqual(encoder.encode('', True), '\xa9\xdc')
93 self.assertEqual(encoder.encode('', True), '')
97 self.assertEqual(encoder.encode(u'\u00e6'), '')
98 self.assertRaises(UnicodeEncodeError, encoder.encode, u'\u0123')
99 self.assertEqual(encoder.encode(u'\u0300\u00e6'), '\xab\xc4')
100 self.assertRaises(UnicodeEncodeError, encoder.encode, u'\u0123')
102 self.assertEqual(encoder.encode(u'\u0300'), '\xab\xdc')
103 self.assertEqual(encoder.encode(u'\u00e6'), '')
104 self.assertRaises(UnicodeEncodeError, encoder.encode, u'\u0123')
105 self.assertEqual(encoder.encode(u'', True), '\xa9\xdc')
109 self.assertEqual(encoder.encode(u'\xff'), b'\\xff')
110 self.assertEqual(encoder.encode(u'\n'), b'\n')
225 self.assertNotIn('\x0e', u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
227 e = u'\u3406'.encode(encoding)
238 myunichr(x).encode('iso_2022_jp', 'ignore')
247 self.assertEqual(self.text.encode(self.encoding), self.expected_reset)
252 encoder.encode(char)
260 encoder.encode(char, index == last_index)