mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Bug #1448490: Fix a bug that ISO-2022 codecs could not handle
SS2 (single-shift 2) escape sequences correctly.
This commit is contained in:
parent
6058aa40d2
commit
abb903fd54
3 changed files with 11 additions and 1 deletions
|
@ -75,9 +75,16 @@ class Test_StreamWriter(unittest.TestCase):
|
|||
wr.write('abcd')
|
||||
self.assertEqual(s.getvalue(), 'abcd')
|
||||
|
||||
class Test_ISO2022(unittest.TestCase):
|
||||
def test_g2(self):
|
||||
iso2022jp2 = '\x1b(B:hu4:unit\x1b.A\x1bNi de famille'
|
||||
uni = u':hu4:unit\xe9 de famille'
|
||||
self.assertEqual(iso2022jp2.decode('iso2022-jp-2'), uni)
|
||||
|
||||
def test_main():
|
||||
suite = unittest.TestSuite()
|
||||
suite.addTest(unittest.makeSuite(Test_StreamWriter))
|
||||
suite.addTest(unittest.makeSuite(Test_ISO2022))
|
||||
test_support.run_suite(suite)
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue