Lines Matching refs:encode
33 self.assertEqual(u''.encode(enc), '')
37 self.assertEqual('abcd'.encode(enc), 'abcd')
51 self.assertEqual(data.encode(enc, "test.ignore"), b'')
71 self.assertEqual(encoder.encode(u'\ud30c\uc774\uc36c \ub9c8\uc744'),
74 self.assertEqual(encoder.encode(u'\u2606\u223c\u2606', True),
77 self.assertEqual(encoder.encode(u'', True), '')
78 self.assertEqual(encoder.encode(u'', False), '')
88 self.assertEqual(encoder.encode(u'\u00e6\u0300'), '\xab\xc4')
89 self.assertEqual(encoder.encode(u'\u00e6'), '')
90 self.assertEqual(encoder.encode(u'\u0300'), '\xab\xc4')
91 self.assertEqual(encoder.encode(u'\u00e6', True), '\xa9\xdc')
94 self.assertEqual(encoder.encode(u'\u0300'), '\xab\xdc')
96 self.assertEqual(encoder.encode(u'\u00e6'), '')
97 self.assertEqual(encoder.encode('', True), '\xa9\xdc')
98 self.assertEqual(encoder.encode('', True), '')
102 self.assertEqual(encoder.encode(u'\u00e6'), '')
103 self.assertRaises(UnicodeEncodeError, encoder.encode, u'\u0123')
104 self.assertEqual(encoder.encode(u'\u0300\u00e6'), '\xab\xc4')
105 self.assertRaises(UnicodeEncodeError, encoder.encode, u'\u0123')
107 self.assertEqual(encoder.encode(u'\u0300'), '\xab\xdc')
108 self.assertEqual(encoder.encode(u'\u00e6'), '')
109 self.assertRaises(UnicodeEncodeError, encoder.encode, u'\u0123')
110 self.assertEqual(encoder.encode(u'', True), '\xa9\xdc')
114 self.assertEqual(encoder.encode(u'\xff'), b'\\xff')
115 self.assertEqual(encoder.encode(u'\n'), b'\n')
228 self.assertNotIn('\x0e', u'\N{SOFT HYPHEN}'.encode('iso-2022-jp-2'))
230 e = u'\u3406'.encode(encoding)
241 myunichr(x).encode('iso_2022_jp', 'ignore')
250 self.assertEqual(self.text.encode(self.encoding), self.expected_reset)
255 encoder.encode(char)
263 encoder.encode(char, index == last_index)