Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # |
| 3 | # test_codecmaps_kr.py |
| 4 | # Codec mapping tests for ROK encodings |
| 5 | # |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 6 | |
Benjamin Peterson | ee8712c | 2008-05-20 21:35:26 +0000 | [diff] [blame] | 7 | from test import support |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 8 | from test import test_multibytecodec_support |
| 9 | import unittest |
| 10 | |
| 11 | class TestCP949Map(test_multibytecodec_support.TestBase_Mapping, |
| 12 | unittest.TestCase): |
| 13 | encoding = 'cp949' |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 14 | mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT' \ |
| 15 | '/WINDOWS/CP949.TXT' |
| 16 | |
| 17 | |
| 18 | class TestEUCKRMap(test_multibytecodec_support.TestBase_Mapping, |
| 19 | unittest.TestCase): |
| 20 | encoding = 'euc_kr' |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 21 | mapfileurl = 'http://people.freebsd.org/~perky/i18n/EUC-KR.TXT' |
| 22 | |
Guido van Rossum | 61e21b5 | 2007-08-20 19:06:03 +0000 | [diff] [blame] | 23 | # A4D4 HANGUL FILLER indicates the begin of 8-bytes make-up sequence. |
| 24 | pass_enctest = [(b'\xa4\xd4', '\u3164')] |
| 25 | pass_dectest = [(b'\xa4\xd4', '\u3164')] |
| 26 | |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 27 | |
| 28 | class TestJOHABMap(test_multibytecodec_support.TestBase_Mapping, |
| 29 | unittest.TestCase): |
| 30 | encoding = 'johab' |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 31 | mapfileurl = 'http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/' \ |
| 32 | 'KSC/JOHAB.TXT' |
| 33 | # KS X 1001 standard assigned 0x5c as WON SIGN. |
| 34 | # but, in early 90s that is the only era used johab widely, |
| 35 | # the most softwares implements it as REVERSE SOLIDUS. |
| 36 | # So, we ignore the standard here. |
Guido van Rossum | 005ebb1 | 2007-07-23 18:06:59 +0000 | [diff] [blame] | 37 | pass_enctest = [(b'\\', '\u20a9')] |
| 38 | pass_dectest = [(b'\\', '\u20a9')] |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 39 | |
| 40 | def test_main(): |
Benjamin Peterson | ee8712c | 2008-05-20 21:35:26 +0000 | [diff] [blame] | 41 | support.run_unittest(__name__) |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 42 | |
Hye-Shik Chang | 3e2a306 | 2004-01-17 14:29:29 +0000 | [diff] [blame] | 43 | if __name__ == "__main__": |
| 44 | test_main() |