Jump to content

Unified Hangul Code

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by HarJIT (talk | contribs) at 11:19, 15 October 2021. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Unified Hangul Code
Layout of the Unified Hangul Code
Alias(es)Windows Code Page 949, IBM Code Page 1363
Language(s)Korean
StandardWHATWG Encoding Standard (as "EUC-KR")[1]
ClassificationExtended ISO 646,[a] variable-width encoding, CJK encoding
ExtendsEUC-KR
Other related encoding(s)KPS 9566-2003, KPS 9566-2011
  1. ^ Not in the strictest sense of the term, as ASCII bytes can appear as trail bytes, although this is limited to letter bytes.

Unified Hangul Code (UHC),[2][a] or Extended Wansung,[3][b] also known under Microsoft Windows as Code Page 949 (Windows-949, MS949 or ambiguously CP949), is the Microsoft Windows code page for the Korean language. It is an extension of Wansung Code (KS C 5601:1987, encoded as EUC-KR) to include all 11172 non-partial Hangul syllables present in Johab (KS C 5601:1992 annex 3).[3][2] This corresponds to the pre-composed syllables available in Unicode 2.0 and later.

Wansung Code has the drawback that it only assigns codes for the 2350 precomposed Hangul syllables which have their own KS X 1001 (KS C 5601) codepoints (out of 11172 in total, not counting those using obsolete jamo), and requires others to use eight-byte composition sequences, which are not supported by some partial implementations of the standard.[4] UHC resolves this by assigning single codes for all possible syllables constructed using modern jamo, by making assignments outside of the encoding space used for KS X 1001.

The lead byte range is extended to 0x81–FE, and the trail byte range is extended to 0x41–5A, 0x61–7A and 0x81–FE (in EUC-KR, both ranges are 0xA1–FE). The codes outside the EUC-KR ranges are used for the additional hangul.[5] If considered separately, both the EUC-KR Hangul block and the UHC extended Hangul section are in Unicode order.[1]

Terminology

Unified Hangul Code is not registered with IANA as a standard to communicate information over the Internet.[6] Alternatives include UTF-8. However, the W3C/WHATWG Encoding Standard used by HTML5 incorporates the Unified Hangul Code extensions into its definition of "EUC-KR".[1]

Microsoft assigns Windows-949 the label "ks_c_5601-1987",[7][8] which properly applies to KS X 1001 itself (KS C 5601 being the original name of KS X 1001).[9] The WHATWG treat the label "ks_c_5601-1987" interchangeably with "EUC-KR" with the intent of being "compatible with deployed content".[10] The Unicode Consortium's "OBSOLETE/EASTASIA" collection of withdrawn mappings included mappings for Unified Hangul Code as "KSC5601.TXT", with the automatically derived mappings for 7-bit KS X 1001 being included as "KSX1001.TXT".[11]

IBM's code page 949 is another, otherwise unrelated, extension of EUC-KR. International Components for Unicode (ICU) uses "cp949", "949" or "ibm-949" to refer to that IBM code page,[12] and "ms949" or "windows-949" (or several variants of "ks_c_5601-1987") to refer to the Windows mapping of UHC.[13] Python, by contrast, recognises "cp949", "949", "ms949" and "uhc" as labels for UHC, and does not include an IBM-949 codec.[14] Out of the labels incorporating the code page number, the WHATWG recognise only "windows-949".[10]

IBM's code page for Unified Hangul Code is called Code page 1363 (IBM-1363), or "Korean MS-Win". It is a combination of SBCS Code page 1126 and DBCS Code page 1362.[15][16][17][18][19] It differs in having a single byte mapping of 0x5C to the Won sign (U+20A9);[20][21][22] Windows maps 0x5C to U+005C (the Unicode code point for the backslash) as in ASCII,[13] although fonts often still render it as a Won sign.[23] Unicode mapping of the wave dash (0xA1AD) also differs, with the IBM mapping favouring U+301C,[24] while the Microsoft mapping favours U+223C (Tilde Operator).[25] The IBM mapping for UHC is available as "ibm-1363" in ICU,[20] whereas the ICU "windows-949" codec is referred to as IBM-1261 in some ICU source code comments.[26]

Single byte codes

Following is the single-byte portion of the code page as defined by IBM. Similarly to Code page 437, the control code bytes may be used as control codes or graphical codes depending on context—the graphical codes are shown below. Microsoft uses ASCII mappings for all ASCII bytes, although the backslash may still be rendered as a won sign.

Code page 1126[27][28][29][30]
_0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _A _B _C _D _E _F
0_
0
Template:Chset-color-ctrl|NUL
0000
Template:Chset-color-graph-box|
250C
Template:Chset-color-graph-box|
2510
Template:Chset-color-graph-box|
2514
Template:Chset-color-graph-box|
2518
Template:Chset-color-graph-box|
2502
Template:Chset-color-graph-box|
2500
Template:Chset-color-punct|
2022
Template:Chset-color-graph|
25D8
Template:Chset-color-graph|
25CB
Template:Chset-color-graph|
25D9
Template:Chset-color-graph|
2642
Template:Chset-color-graph|
2640
Template:Chset-color-graph|
266A
Template:Chset-color-graph|
266B
Template:Chset-color-graph|
263C
1_
16
Template:Chset-color-graph-box|
253C
Template:Chset-color-graph|
25C4
Template:Chset-color-graph|
2195
Template:Chset-color-punct|
203C
Template:Chset-color-punct|
00B6
Template:Chset-color-graph-box|
2534
Template:Chset-color-graph-box|
252C
Template:Chset-color-graph-box|
2524
Template:Chset-color-graph|
2191
Template:Chset-color-graph-box|
251C
Template:Chset-color-graph|
2192
Template:Chset-color-graph|
2190
Template:Chset-color-graph|
221F
Template:Chset-color-graph|
2194
Template:Chset-color-graph|
25B2
Template:Chset-color-graph|
25BC
2_
32
Template:Chset-color-misc|SP
0020
Template:Chset-color-punct|!
0021
Template:Chset-color-punct|"
0022
Template:Chset-color-punct|#
0023
Template:Chset-color-graph|$
0024
Template:Chset-color-punct|%
0025
Template:Chset-color-punct|&
0026
Template:Chset-color-punct|'
0027
Template:Chset-color-punct|(
0028
Template:Chset-color-punct|)
0029
Template:Chset-color-punct|*
002A
Template:Chset-color-graph|+
002B
Template:Chset-color-punct|,
002C
Template:Chset-color-punct|-
002D
Template:Chset-color-punct|.
002E
Template:Chset-color-punct|/
002F
3_
48
Template:Chset-color-digit|0
0030
Template:Chset-color-digit|1
0031
Template:Chset-color-digit|2
0032
Template:Chset-color-digit|3
0033
Template:Chset-color-digit|4
0034
Template:Chset-color-digit|5
0035
Template:Chset-color-digit|6
0036
Template:Chset-color-digit|7
0037
Template:Chset-color-digit|8
0038
Template:Chset-color-digit|9
0039
Template:Chset-color-punct|:
003A
Template:Chset-color-punct|;
003B
Template:Chset-color-graph|<
003C
Template:Chset-color-graph|=
003D
Template:Chset-color-graph|>
003E
Template:Chset-color-punct|?
003F
4_
64
Template:Chset-color-punct|@
0040
Template:Chset-color-letter|A
0041
Template:Chset-color-letter|B
0042
Template:Chset-color-letter|C
0043
Template:Chset-color-letter|D
0044
Template:Chset-color-letter|E
0045
Template:Chset-color-letter|F
0046
Template:Chset-color-letter|G
0047
Template:Chset-color-letter|H
0048
Template:Chset-color-letter|I
0049
Template:Chset-color-letter|J
004A
Template:Chset-color-letter|K
004B
Template:Chset-color-letter|L
004C
Template:Chset-color-letter|M
004D
Template:Chset-color-letter|N
004E
Template:Chset-color-letter|O
004F
5_
80
Template:Chset-color-letter|P
0050
Template:Chset-color-letter|Q
0051
Template:Chset-color-letter|R
0052
Template:Chset-color-letter|S
0053
Template:Chset-color-letter|T
0054
Template:Chset-color-letter|U
0055
Template:Chset-color-letter|V
0056
Template:Chset-color-letter|W
0057
Template:Chset-color-letter|X
0058
Template:Chset-color-letter|Y
0059
Template:Chset-color-letter|Z
005A
Template:Chset-color-punct|[
005B
Template:Chset-color-graph-box|
20A9
Template:Chset-color-punct|]
005D
Template:Chset-color-graph|^
005E
Template:Chset-color-punct|_
005F
6_
96
Template:Chset-color-graph|`
0060
Template:Chset-color-letter|a
0061
Template:Chset-color-letter|b
0062
Template:Chset-color-letter|c
0063
Template:Chset-color-letter|d
0064
Template:Chset-color-letter|e
0065
Template:Chset-color-letter|f
0066
Template:Chset-color-letter|g
0067
Template:Chset-color-letter|h
0068
Template:Chset-color-letter|i
0069
Template:Chset-color-letter|j
006A
Template:Chset-color-letter|k
006B
Template:Chset-color-letter|l
006C
Template:Chset-color-letter|m
006D
Template:Chset-color-letter|n
006E
Template:Chset-color-letter|o
006F
7_
112
Template:Chset-color-letter|p
0070
Template:Chset-color-letter|q
0071
Template:Chset-color-letter|r
0072
Template:Chset-color-letter|s
0073
Template:Chset-color-letter|t
0074
Template:Chset-color-letter|u
0075
Template:Chset-color-letter|v
0076
Template:Chset-color-letter|w
0077
Template:Chset-color-letter|x
0078
Template:Chset-color-letter|y
0079
Template:Chset-color-letter|z
007A
Template:Chset-color-punct|{
007B
Template:Chset-color-graph||
007C
Template:Chset-color-punct|}
007D
Template:Chset-color-graph|~
007E
Template:Chset-color-graph|
2302

  Letter  Number  Punctuation  Symbol  Other  Undefined  Differences from code page 437

Footnotes

References

  1. ^ a b c van Kesteren, Anne, "5. Indexes (§ index EUC-KR)", Encoding Standard, WHATWG
  2. ^ a b "INFO: Hangul (Korean) Character Sets", Microsoft Support, Microsoft
  3. ^ a b Zsigri, Gyula (2002-06-18). "KSC and UHC".
  4. ^ Shin, Jungshik. "What are KS X 1001(KS C 5601) and other Hangul codes?". Hangul & Internet in Korea FAQ.
  5. ^ Lunde, Ken (13 January 2009). "Appendix F: Vendor encoding Methods" (PDF). CJKV Information Processing (2nd ed.). O'Reilly Media. ISBN 978-0-596-51447-1.
  6. ^ "Character Sets". Iana.org. Retrieved 2017-01-11.
  7. ^ "Encoding.WindowsCodePage Property - .NET Framework (current version)". MSDN. Microsoft.
  8. ^ "Code Page Identifiers", Windows Dev Center, Microsoft
  9. ^ IBM; Unicode Consortium. "convrtrs.txt". International Components for Unicode. v. 59180.0.1. <quote from="Jungshik Shin"> [...] using KS C 5601 or related names to denote EUC-KR or windows-949 is very much misleading [...] It's just the name of a 94 x 94 Korean coded character set standard which can be invoked on either GL (with MSB reset) or GR (with MSB set).
  10. ^ a b van Kesteren, Anne. "4.2. Names and labels". Encoding Standard. WHATWG.
  11. ^ Jungshik Shin. "KSX1001.TXT: KS X 1001 to Unicode table". Unicode, Inc.
  12. ^ "ibm-949_P110-1999 (alias cp949)", Converter Explorer, International Components for Unicode
  13. ^ a b "windows-949-2000", Converter Explorer, International Components for Unicode
  14. ^ "codecs — Codec registry and base classes § Standard Encodings". Python 3.7.2 documentation. Python Software Foundation.
  15. ^ "Coded character set identifiers - CCSID 1363", IBM Globalization, IBM, archived from the original on 2014-11-29
  16. ^ "Code page 1126 information document". Archived from the original on 2017-01-16.
  17. ^ "CCSID 1126 information document". Archived from the original on 2016-03-27.
  18. ^ "Code page 1362 information document". Archived from the original on 2016-03-17.
  19. ^ "CCSID 1362 information document". Archived from the original on 2016-03-27.
  20. ^ a b "ibm-1363", Converter Explorer, International Components for Unicode
  21. ^ Code Page CPGID 01126 (pdf) (PDF), IBM
  22. ^ Code Page CPGID 01126 (txt), IBM
  23. ^ Kaplan, Michael S. (2005-09-17), "When is a backslash not a backslash?", Sorting it all out
  24. ^ "ibm-1363_P110-1997 (lead byte A1)". ICU Demonstration - Converter Explorer. International Components for Unicode.
  25. ^ "windows-949-2000 (lead byte A1)". ICU Demonstration - Converter Explorer. International Components for Unicode.
  26. ^ See, for reference, ucnv_lmb.cpp (Brendan Murray, Jim Snyder-Grant), where the lead byte 0x11 is commented as referring to "Korean: ibm-1261" after the definition of ULMBCS_GRP_KO, but it is mapped to the "windows-949" ICU codec in the OptGroupByteToCPName array later in the file.
  27. ^ Code Page CPGID 01126 (pdf) (PDF), IBM
  28. ^ Code Page CPGID 01126 (txt), IBM
  29. ^ ICU Demonstration mapping IBM-1363 to Unicode
  30. ^ ICU Demonstration mapping IBM-1363C (ASCII based variant) to Unicode