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