diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js')
-rw-r--r-- | intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js b/intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js new file mode 100644 index 000000000..db0ba73b4 --- /dev/null +++ b/intl/uconv/tests/unit/test_decode_EUCKR_Hangul.js @@ -0,0 +1,31 @@ +// Tests conversion of 8-byte decomposed Hangul from EUC-KR (and variants) +// to Unicode, including invalid input + +load('CharsetConversionTests.js'); +load('hangulTestStrings.js'); + +const aliases = [ "euc-kr", "EUC-KR", "iso-ir-149", "ks_c_5601-1989", "ksc_5601", "ksc5601", "korean", "csksc56011987", "windows-949", "ks_c_5601-1987", "cseuckr"]; + +function to8byteHangul(byte3, byte5, byte7) +{ + return String.fromCharCode(0xa4, 0xd4, 0xa4, byte3, 0xa4, byte5, 0xa4, byte7); +} + +function run_test() { + var converter = CreateScriptableConverter(); + for (var i = 0; i < aliases.length; ++i) { + var row = 0; + for (var byte3 = 0xa0; byte3 < 0xc0; ++byte3) { + for (var byte5 = 0xbe; byte5 < 0xd5; ++byte5) { + var inString = " row " + byte3.toString(16) + "_" + + byte5.toString(16) + "_: "; + for (var byte7 = 0xa0; byte7 < 0xc0; ++byte7) { + inString += to8byteHangul(byte3, byte5, byte7) + " "; + } + inString += to8byteHangul(byte3, byte5, 0xd4) + " "; + checkDecode(converter, aliases[i], inString, expectedStrings[row++]); + } + } + do_check_eq(row, expectedStrings.length); + } +} |