1 | n/a | # |
---|
2 | n/a | # test_codecmaps_kr.py |
---|
3 | n/a | # Codec mapping tests for ROK encodings |
---|
4 | n/a | # |
---|
5 | n/a | |
---|
6 | n/a | from test import multibytecodec_support |
---|
7 | n/a | import unittest |
---|
8 | n/a | |
---|
9 | n/a | class TestCP949Map(multibytecodec_support.TestBase_Mapping, |
---|
10 | n/a | unittest.TestCase): |
---|
11 | n/a | encoding = 'cp949' |
---|
12 | n/a | mapfileurl = 'http://www.pythontest.net/unicode/CP949.TXT' |
---|
13 | n/a | |
---|
14 | n/a | |
---|
15 | n/a | class TestEUCKRMap(multibytecodec_support.TestBase_Mapping, |
---|
16 | n/a | unittest.TestCase): |
---|
17 | n/a | encoding = 'euc_kr' |
---|
18 | n/a | mapfileurl = 'http://www.pythontest.net/unicode/EUC-KR.TXT' |
---|
19 | n/a | |
---|
20 | n/a | # A4D4 HANGUL FILLER indicates the begin of 8-bytes make-up sequence. |
---|
21 | n/a | pass_enctest = [(b'\xa4\xd4', '\u3164')] |
---|
22 | n/a | pass_dectest = [(b'\xa4\xd4', '\u3164')] |
---|
23 | n/a | |
---|
24 | n/a | |
---|
25 | n/a | class TestJOHABMap(multibytecodec_support.TestBase_Mapping, |
---|
26 | n/a | unittest.TestCase): |
---|
27 | n/a | encoding = 'johab' |
---|
28 | n/a | mapfileurl = 'http://www.pythontest.net/unicode/JOHAB.TXT' |
---|
29 | n/a | # KS X 1001 standard assigned 0x5c as WON SIGN. |
---|
30 | n/a | # but, in early 90s that is the only era used johab widely, |
---|
31 | n/a | # the most softwares implements it as REVERSE SOLIDUS. |
---|
32 | n/a | # So, we ignore the standard here. |
---|
33 | n/a | pass_enctest = [(b'\\', '\u20a9')] |
---|
34 | n/a | pass_dectest = [(b'\\', '\u20a9')] |
---|
35 | n/a | |
---|
36 | n/a | if __name__ == "__main__": |
---|
37 | n/a | unittest.main() |
---|