This commit is contained in:
Benjamin Peterson 2012-12-02 11:21:02 -05:00
commit 26e5335a46
3 changed files with 13 additions and 2 deletions

View file

@ -45,6 +45,10 @@ class Test_MultibyteCodec(unittest.TestCase):
self.assertRaises(IndexError, dec,
b'apple\x92ham\x93spam', 'test.cjktest')
def test_errorhandler_returns_bytes(self):
enc = "\u30fb\udc80".encode('gb18030', 'surrogateescape')
self.assertEqual(enc, b'\x819\xa79\x80')
def test_codingspec(self):
try:
for enc in ALL_CJKENCODINGS: