{{Short description|Official Chinese character encoding}} {{More citations needed|date=September 2016}} {{Infobox character encoding | name = GB 18030 | mime = GB18030 | alias = Code page 54936 | image = GB18030 encoding.svg | caption = GB 18030 encoding layout. "Half codes" indicates codes used in pairs as four-byte codes. | standard = GB 18030-2022, GB 18030-2005, GB 18030-2000 | lang = International, but primarily meant for Chinese | status = | encodes = ISO 10646 (Unicode) | extends = EUC-CN, GBK | prev = GBK, GB2312 | next = | classification = Unicode Transformation Format, extended ASCII,{{efn|Not in the strictest sense of the term, as ASCII bytes can appear as trail bytes.}} variable-width encoding, CJK encoding |extra = <div style="text-align: left;">{{notelist}}</div> }}
'''GB 18030''' is a Chinese government standard, described as ''Information Technology — Chinese coded character set'' and defines the required language and character support necessary for software in China. '''GB18030''' is the registered Internet name for the official character set of the People's Republic of China (PRC) superseding GB2312.<ref name=IANA>{{cite web|url=https://www.iana.org/assignments/charset-reg/GB18030 |title=Application of IANA Charset Registration for GB18030 |publisher=IANA Character Set Registrations |date=2002-03-15 |author=Anthony Fok |access-date=2016-12-05}}</ref> As a Unicode Transformation Format{{efn|Note that GB18030 omits surrogates; see {{slink|#Mapping}}.}} (i.e. an encoding of all Unicode code points), GB18030 supports both simplified and traditional Chinese characters. It is also compatible with legacy encodings including GB/T 2312, CP936,{{efn|The euro sign is an exception which is given a single byte code of 0x80 in Microsoft's later versions of CP936/GBK and a two byte code of A2 E3 in GB18030.<!--any other exceptions? anyone suicidal enough to check?-->}} and GBK 1.0.
The Unicode Consortium has warned implementers that the latest version of this Chinese standard, '''GB 18030-2022''', introduces what they describe as "disruptive changes" from the previous version GB 18030-2005 "involving 33 different characters and 55 code positions".<ref>{{Cite web |author= Peter Constable |title= Disruptive Changes in GB 18030-2022 |url=https://www.unicode.org/L2/L2022/22274-disruptive-changes.pdf |access-date=2024-02-12 |website=www.unicode.org }}</ref> GB 18030-2022 was enforced from 1 August 2023.<ref>{{Cite web |title=[JDK-8301119] Support for GB18030-2022 - Java Bug System |url=https://bugs.openjdk.org/browse/JDK-8301119 |access-date=2023-08-14 |website=bugs.openjdk.org}}</ref> It has been implemented in ICU 73.2; and in Java 21,<ref>{{Cite web |title=JDK 21 Release Notes |url=https://jdk.java.net/21/release-notes |access-date=2023-08-14 |website=jdk.java.net}}</ref> and backported to older Java 8, 11, 17 (LTS releases) and 20.0.2.<ref>{{Cite web |title=[JDK-8307340] Release Note: Support for GB18030-2022 - Java Bug System |url=https://bugs.openjdk.org/browse/JDK-8307340 |access-date=2023-08-30 |website=bugs.openjdk.org}}</ref>
In addition to the encoding method, this standard contains requirements about which additional scripts and languages should be represented, and to whom this standard is applicable.<ref name="CESI-FAQ">{{cite web|url=http://www.cc.cesi.cn/UpLoadFolder/OtherFile/200907/2009070816133686.doc|title=GB18030 符合性问与答|last=CESI|author-link=China Electronics Standardization Institute|date=2009-07-08|website=CESI Certification Center|trans-title=GB18030 compliance FAQ|archive-url=https://web.archive.org/web/20160928145226/http://www.cc.cesi.cn/UpLoadFolder/OtherFile/200907/2009070816133686.doc|archive-date=2016-09-28|access-date=2016-10-12|quote=''Page 4'' 同时达到以下两个要求的产品,为符合GB 18030-2005强制部分的产品:①产品可以正确输入、输出、处理GB 18030-2005强制部分规定的全部汉字字符;②产品可以正确识别GB 18030-2005强制性部分规定的全部汉字字符对应的编码。 [A product compliant with the mandatory part of GB 18030 must be able to correctly a) input, output and process all Chinese characters defined in the mandatory set; b) recognize encodings for characters in the mandatory set.]}} [https://archive.org/details/GB18030-compliance-faq Alt URL]</ref> This standard however does not define the official character forms for the Chinese characters; this is standardised in ''List of Commonly Used Standard Chinese Characters''.
== History == {{See also|GB 2312|GBK (character encoding)|Code page 936 (Microsoft Windows)}} The GB18030 character set is formally called "Chinese National Standard GB 18030-2005: Information Technology—Chinese coded character set". '''GB''' abbreviates {{Transliteration|zh|pinyin|Guójiā Biāozhǔn}} ({{lang|zh-Hans-CN|国家标准}}), which means ''national standard'' in Chinese. The standard was published by the China Standard Press, Beijing, 8 November 2005. Only a portion of the standard is mandatory.<ref name="CESI-FAQ"/> Since 1 May 2006, support for the mandatory subset is officially required for all software products sold in the PRC. {| class="wikitable floatright" |+ Different Unicode mappings between GB 18030 versions ! rowspan=2 | GB byte<br />sequence !! colspan=2 | Unicode code point |- ! GB 18030-2000 ! GB 18030-2005 |- | A8 BC (ḿ)|| style="background:#ccf;"|{{code|U+E7C7}}||{{unichar|1E3F}} |- | 81 35 F4 37||{{unichar|1E3F}}|| style="background:#ccf;"|{{code|U+E7C7}} |}
An older version of the standard, known as "Chinese National Standard GB 18030-2000: Information Technology—Chinese ideograms coded character set for information interchange—Extension for the basic set", was published on March 17, 2000. The encoding scheme stays the same in the new version, and the only difference in GB-to-Unicode mapping is that GB 18030-2000 mapped the character {{code|A8 BC}} (ḿ) to a private use code point U+E7C7, and character {{code|81 35 F4 37}} (without specifying any glyph) to U+1E3F (ḿ), whereas GB 18030-2005 swaps these two mapping assignments.<ref name="gb18030-2005">{{Cite book|url=https://archive.org/details/GB18030-2005|title=GB 18030-2005: Information Technology—Chinese <!--"ideograms" word missing in this version unlike in 2000 version, see comment for that ref. --> coded character set|last=Standardization Administration of China (SAC)|date=2005-11-18}}</ref>{{Rp|534}} More code points are now associated with characters due to update of Unicode, especially the appearance of CJK Unified Ideographs Extension B. Some characters used by ethnic minorities in China, such as Mongolian characters and Tibetan characters (GB 16959-1997 and GB/T 20542-2006), have been added as well, which accounts for the renaming of the standard.
Compared with its ancestors, GB 18030's mapping to Unicode has been modified for the 81 characters that were provisionally assigned a Unicode Private Use Area code point (U+E000–F8FF) in GBK 1.0 and that have later been encoded in Unicode.<ref>{{cite web|title=Unicode FAQ on GB 18030|url=https://ssl.icu-project.org/docs/papers/unicode-gb18030-faq.html|website=ICU Project|access-date=10 September 2016|archive-date=2 March 2018|archive-url=https://web.archive.org/web/20180302231754/https://ssl.icu-project.org/docs/papers/unicode-gb18030-faq.html|url-status=dead}}</ref> This is specified in Appendix E of GB 18030.<ref name="gb18030-2005"/>{{rp|534}}<ref name="gb18030-2000">{{Cite book|url=https://archive.org/details/GB18030-2000 |title=GB 18030-2000: Information Technology—Chinese <!-- The following word is in English part of Chinese scanned text, but not in caption under: --> ideograms coded character set for information interchange—Extension for the basic set |work=Standardization Administration of China (SAC) |date=2000-03-17}}</ref>{{Rp|499}} There are 24 characters in GB 18030-2005 that are still mapped to Unicode PUA.<ref name=Lunde2006>{{cite web|last1=Lunde|first1=Ken|title=L2/06-394 Update on GB 18030:2005|url=https://www.unicode.org/L2/L2006/06394-gb18030-2005.txt|publisher=Unicode Technical Committee Document Registry|ref=L2-06-394|date=2006|access-date=28 September 2016}}</ref>
In the GB 18030-2022 update, the requirements for characters to be mapped to PUA has been lifted completely and all characters should be mapped to their standard Unicode codepoints. Of these, 18 mappings were updated by position-swapping similar to what happened between GBK and GB 18030. The remaining six kept the two-byte PUA mappings, so that a change to the 4-byte sequence is needed to follow the non-PUA preference.<ref name="gb18030-2022-kenlunde">{{cite web |last1=Lunde |first1=Ken |title=The GB 18030-2022 Standard |url=https://ken-lunde.medium.com/the-gb-18030-2022-standard-3d0ebaeb4132 |website=Medium |access-date=7 August 2022 |language=en |date=4 August 2022}}</ref>
{| class="wikitable" |+ {{anchor|PUA}}Private use characters in GB-to-Unicode mappings ! rowspan=2 | GB byte<br />sequence !! colspan=4 | Unicode code point {{ref label|GB18030-PUA-blue|a}} |- ! GBK 1.0<ref>{{cite web|title=Group:GBK外字|url=http://zht.glyphwiki.org/wiki/Group:GBK%E5%A4%96%E5%AD%97|website=GlyphWiki|access-date=11 September 2016}}</ref><ref name="gb18030-2005"/>{{rp|534}} ! GB 18030-2005<ref name=Lunde2006/> ! Unicode 4.1 ! GB 18030-2022<ref name="gb18030-2022-kenlunde"/> |- |A6 D9<ref name="cjkv-info-proc">{{cite book|last1=Lunde|first1=Ken|title=CJKV Information Processing|date=December 2008|publisher=O'Reilly Media, Inc|isbn=978-0-596-51447-1|url=https://books.google.com/books?id=SA92uQqTB-AC|access-date=11 September 2016}}</ref>{{rp|108}}|||| style="background:#ccf;"|<code>U+E78D</code> | colspan="2" style="text-align:center;"|{{unichar|FE10}} |- |A6 DA|||| style="background:#ccf;"|<code>U+E78E</code>|| colspan="2" style="text-align:center;"|{{unichar|FE12}} |- |A6 DB|||| style="background:#ccf;"|<code>U+E78F</code>|| colspan="2" style="text-align:center;"|{{unichar|FE11}} |- |A6 DC|||| style="background:#ccf;"|<code>U+E790</code>|| colspan="2" style="text-align:center;"|{{unichar|FE13}} |- |A6 DD|||| style="background:#ccf;"|<code>U+E791</code>|| colspan="2" style="text-align:center;"|{{unichar|FE14}} |- |A6 DE|||| style="background:#ccf;"|<code>U+E792</code>|| colspan="2" style="text-align:center;"|{{unichar|FE15}} |- |A6 DF|||| style="background:#ccf;"|<code>U+E793</code>|| colspan="2" style="text-align:center;"|{{unichar|FE16}} |- |A6 EC|||| style="background:#ccf;"|<code>U+E794</code>|| colspan="2" style="text-align:center;"|{{unichar|FE17}} |- |A6 ED|||| style="background:#ccf;"|<code>U+E795</code>|| colspan="2" style="text-align:center;"|{{unichar|FE18}} |- |A6 F3|||| style="background:#ccf;"|<code>U+E796</code>|| colspan="2" style="text-align:center;"|{{unichar|FE19}} |- |A8 BC|| style="background:#ccf;"|<code>U+E7C7</code>|| colspan="3" style="text-align:center;"|{{unichar|1E3F}} |- |A8 BF|| style="background:#ccf;"|<code>U+E7C8</code>|| colspan="3" style="text-align:center;"|{{unichar|01F9}} |- |A9 89|| style="background:#ccf;"|<code>U+E7E7</code>|| colspan="3" style="text-align:center;"|{{unichar|303E}} |- |A9 8A|| style="background:#ccf;"|<code>U+E7E8</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF0}} |- |A9 8B|| style="background:#ccf;"|<code>U+E7E9</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF1}} |- |A9 8C|| style="background:#ccf;"|<code>U+E7EA</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF2}} |- |A9 8D|| style="background:#ccf;"|<code>U+E7EB</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF3}} |- |A9 8E|| style="background:#ccf;"|<code>U+E7EC</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF4}} |- |A9 8F|| style="background:#ccf;"|<code>U+E7ED</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF5}} |- |A9 90|| style="background:#ccf;"|<code>U+E7EE</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF6}} |- |A9 91|| style="background:#ccf;"|<code>U+E7EF</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF7}} |- |A9 92|| style="background:#ccf;"|<code>U+E7F0</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF8}} |- |A9 93|| style="background:#ccf;"|<code>U+E7F1</code>|| colspan="3" style="text-align:center;"|{{unichar|2FF9}} |- |A9 94<ref name="cjkv-info-proc"/>{{rp|173}}|| style="background:#ccf;"|<code>U+E7F2</code>|| colspan="3" style="text-align:center;"|{{unichar|2FFA}} |- |A9 95|| style="background:#ccf;"|<code>U+E7F3</code>|| colspan="3" style="text-align:center;"|{{unichar|2FFB}} |- |FE 50|| style="background:#ccf;"|<code>U+E815</code>|| colspan="3" style="text-align:center;"|{{unichar|2E81}} |- |FE 51|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E816</code>||{{unichar|20087}}{{ref label|GB18030-2022-1|b}}||style="background:#ccf;"|<code>U+E816</code> |- |FE 52|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E817</code>||{{unichar|20089}}{{ref label|GB18030-2022-2|c}}||style="background:#ccf;"|<code>U+E817</code> |- |FE 53|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E818</code>||{{unichar|200CC}}{{ref label|GB18030-2022-3|d}}||style="background:#ccf;"|<code>U+E818</code> |- |FE 54|| style="background:#ccf;"|<code>U+E819</code>|| colspan="3" style="text-align:center;"|{{unichar|2E84}} |- |FE 55|| style="background:#ccf;"|<code>U+E81A</code>|| colspan="3" style="text-align:center;"|{{unichar|3473}} |- |FE 56|| style="background:#ccf;"|<code>U+E81B</code>|| colspan="3" style="text-align:center;"|{{unichar|3447}} |- |FE 57|| style="background:#ccf;"|<code>U+E81C</code>|| colspan="3" style="text-align:center;"|{{unichar|2E88}} |- |FE 58|| style="background:#ccf;"|<code>U+E81D</code>|| colspan="3" style="text-align:center;"|{{unichar|2E8B}} |- |FE 59|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E81E</code>|| colspan="2" style="text-align:center;"|{{unichar|9FB4}} |- |FE 5A|| style="background:#ccf;"|<code>U+E81F</code>|| colspan="3" style="text-align:center;"|{{unichar|359E}} |- |FE 5B|| style="background:#ccf;"|<code>U+E820</code>|| colspan="3" style="text-align:center;"|{{unichar|361A}} |- |FE 5C|| style="background:#ccf;"|<code>U+E821</code>|| colspan="3" style="text-align:center;"|{{unichar|360E}} |- |FE 5D|| style="background:#ccf;"|<code>U+E822</code>|| colspan="3" style="text-align:center;"|{{unichar|2E8C}} |- |FE 5E|| style="background:#ccf;"|<code>U+E823</code>|| colspan="3" style="text-align:center;"|{{unichar|2E97}} |- |FE 5F|| style="background:#ccf;"|<code>U+E824</code>|| colspan="3" style="text-align:center;"|{{unichar|396E}} |- |FE 60|| style="background:#ccf;"|<code>U+E825</code>|| colspan="3" style="text-align:center;"|{{unichar|3918}} |- |FE 61|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E826</code>|| colspan="2" style="text-align:center;"|{{unichar|9FB5}} |- |FE 62|| style="background:#ccf;"|<code>U+E827</code>|| colspan="3" style="text-align:center;"|{{unichar|39CF}} |- |FE 63|| style="background:#ccf;"|<code>U+E828</code>|| colspan="3" style="text-align:center;"|{{unichar|39DF}} |- |FE 64|| style="background:#ccf;"|<code>U+E829</code>|| colspan="3" style="text-align:center;"|{{unichar|3A73}} |- |FE 65|| style="background:#ccf;"|<code>U+E82A</code>|| colspan="3" style="text-align:center;"|{{unichar|39D0}} |- |FE 66|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E82B</code>|| colspan="2" style="text-align:center;"|{{unichar|9FB6}} |- |FE 67|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E82C</code>|| colspan="2" style="text-align:center;"|{{unichar|9FB7}} |- |FE 68|| style="background:#ccf;"|<code>U+E82D</code>|| colspan="3" style="text-align:center;"|{{unichar|3B4E}} |- |FE 69|| style="background:#ccf;"|<code>U+E82E</code>|| colspan="3" style="text-align:center;"|{{unichar|3C6E}} |- |FE 6A|| style="background:#ccf;"|<code>U+E82F</code>|| colspan="3" style="text-align:center;"|{{unichar|3CE0}} |- |FE 6B|| style="background:#ccf;"|<code>U+E830</code>|| colspan="3" style="text-align:center;"|{{unichar|2EA7}} |- |FE 6C|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E831</code>||{{unichar|215D7}}{{ref label|GB18030-2022-4|e}}||style="background:#ccf;"|<code>U+E831</code> |- |FE 6D|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E832</code>|| colspan="2" style="text-align:center;"|{{unichar|9FB8}} |- |FE 6E|| style="background:#ccf;"|<code>U+E833</code>|| colspan="3" style="text-align:center;"|{{unichar|2EAA}} |- |FE 6F|| style="background:#ccf;"|<code>U+E834</code>|| colspan="3" style="text-align:center;"|{{unichar|4056}} |- |FE 70|| style="background:#ccf;"|<code>U+E835</code>|| colspan="3" style="text-align:center;"|{{unichar|415F}} |- |FE 71|| style="background:#ccf;"|<code>U+E836</code>|| colspan="3" style="text-align:center;"|{{unichar|2EAE}} |- |FE 72|| style="background:#ccf;"|<code>U+E837</code>|| colspan="3" style="text-align:center;"|{{unichar|4337}} |- |FE 73|| style="background:#ccf;"|<code>U+E838</code>|| colspan="3" style="text-align:center;"|{{unichar|2EB3}} |- |FE 74|| style="background:#ccf;"|<code>U+E839</code>|| colspan="3" style="text-align:center;"|{{unichar|2EB6}} |- |FE 75|| style="background:#ccf;"|<code>U+E83A</code>|| colspan="3" style="text-align:center;"|{{unichar|2EB7}} |- |FE 76|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E83B</code>||{{unichar|2298F}}{{ref label|GB18030-2022-5|f}}||style="background:#ccf;"|<code>U+E83B</code> |- |FE 77|| style="background:#ccf;"|<code>U+E83C</code>|| colspan="3" style="text-align:center;"|{{unichar|43B1}} |- |FE 78|| style="background:#ccf;"|<code>U+E83D</code>|| colspan="3" style="text-align:center;"|{{unichar|43AC}} |- |FE 79|| style="background:#ccf;"|<code>U+E83E</code>|| colspan="3" style="text-align:center;"|{{unichar|2EBB}} |- |FE 7A|| style="background:#ccf;"|<code>U+E83F</code>|| colspan="3" style="text-align:center;"|{{unichar|43DD}} |- |FE 7B|| style="background:#ccf;"|<code>U+E840</code>|| colspan="3" style="text-align:center;"|{{unichar|44D6}} |- |FE 7C|| style="background:#ccf;"|<code>U+E841</code>|| colspan="3" style="text-align:center;"|{{unichar|4661}} |- |FE 7D|| style="background:#ccf;"|<code>U+E842</code>|| colspan="3" style="text-align:center;"|{{unichar|464C}} |- |FE 7E|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E843</code>|| colspan="2" style="text-align:center;"|{{unichar|9FB9}} |- |FE 80|| style="background:#ccf;"|<code>U+E844</code>|| colspan="3" style="text-align:center;"|{{unichar|4723}} |- |FE 81|| style="background:#ccf;"|<code>U+E845</code>|| colspan="3" style="text-align:center;"|{{unichar|4729}} |- |FE 82|| style="background:#ccf;"|<code>U+E846</code>|| colspan="3" style="text-align:center;"|{{unichar|477C}} |- |FE 83|| style="background:#ccf;"|<code>U+E847</code>|| colspan="3" style="text-align:center;"|{{unichar|478D}} |- |FE 84|| style="background:#ccf;"|<code>U+E848</code>|| colspan="3" style="text-align:center;"|{{unichar|2ECA}} |- |FE 85|| style="background:#ccf;"|<code>U+E849</code>|| colspan="3" style="text-align:center;"|{{unichar|4947}} |- |FE 86|| style="background:#ccf;"|<code>U+E84A</code>|| colspan="3" style="text-align:center;"|{{unichar|497A}} |- |FE 87|| style="background:#ccf;"|<code>U+E84B</code>|| colspan="3" style="text-align:center;"|{{unichar|497D}} |- |FE 88|| style="background:#ccf;"|<code>U+E84C</code>|| colspan="3" style="text-align:center;"|{{unichar|4982}} |- |FE 89|| style="background:#ccf;"|<code>U+E84D</code>|| colspan="3" style="text-align:center;"|{{unichar|4983}} |- |FE 8A|| style="background:#ccf;"|<code>U+E84E</code>|| colspan="3" style="text-align:center;"|{{unichar|4985}} |- |FE 8B|| style="background:#ccf;"|<code>U+E84F</code>|| colspan="3" style="text-align:center;"|{{unichar|4986}} |- |FE 8C|| style="background:#ccf;"|<code>U+E850</code>|| colspan="3" style="text-align:center;"|{{unichar|499F}} |- |FE 8D|| style="background:#ccf;"|<code>U+E851</code>|| colspan="3" style="text-align:center;"|{{unichar|499B}} |- |FE 8E|| style="background:#ccf;"|<code>U+E852</code>|| colspan="3" style="text-align:center;"|{{unichar|49B7}} |- |FE 8F|| style="background:#ccf;"|<code>U+E853</code>|| colspan="3" style="text-align:center;"|{{unichar|49B6}} |- |FE 90|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E854</code>|| colspan="2" style="text-align:center;"|{{unichar|9FBA}} |- |FE 91|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E855</code>||{{unichar|241FE}}{{ref label|GB18030-2022-6|g}}||style="background:#ccf;"|<code>U+E855</code> |- |FE 92|| style="background:#ccf;"|<code>U+E856</code>|| colspan="3" style="text-align:center;"|{{unichar|4CA3}} |- |FE 93|| style="background:#ccf;"|<code>U+E857</code>|| colspan="3" style="text-align:center;"|{{unichar|4C9F}} |- |FE 94|| style="background:#ccf;"|<code>U+E858</code>|| colspan="3" style="text-align:center;"|{{unichar|4CA0}} |- |FE 95|| style="background:#ccf;"|<code>U+E859</code>|| colspan="3" style="text-align:center;"|{{unichar|4CA1}} |- |FE 96|| style="background:#ccf;"|<code>U+E85A</code>|| colspan="3" style="text-align:center;"|{{unichar|4C77}} |- |FE 97|| style="background:#ccf;"|<code>U+E85B</code>|| colspan="3" style="text-align:center;"|{{unichar|4CA2}} |- |FE 98|| style="background:#ccf;"|<code>U+E85C</code>|| colspan="3" style="text-align:center;"|{{unichar|4D13}} |- |FE 99|| style="background:#ccf;"|<code>U+E85D</code>|| colspan="3" style="text-align:center;"|{{unichar|4D14}} |- |FE 9A|| style="background:#ccf;"|<code>U+E85E</code>|| colspan="3" style="text-align:center;"|{{unichar|4D15}} |- |FE 9B|| style="background:#ccf;"|<code>U+E85F</code>|| colspan="3" style="text-align:center;"|{{unichar|4D16}} |- |FE 9C|| style="background:#ccf;"|<code>U+E860</code>|| colspan="3" style="text-align:center;"|{{unichar|4D17}} |- |FE 9D|| style="background:#ccf;"|<code>U+E861</code>|| colspan="3" style="text-align:center;"|{{unichar|4D18}} |- |FE 9E|| style="background:#ccf;"|<code>U+E862</code>|| colspan="3" style="text-align:center;"|{{unichar|4D19}} |- |FE 9F|| style="background:#ccf;"|<code>U+E863</code>|| colspan="3" style="text-align:center;"|{{unichar|4DAE}} |- |FE A0|| colspan="2" style="text-align:center; background:#ccf;"|<code>U+E864</code>|| colspan="2" style="text-align:center;"|{{unichar|9FBB}} |- | colspan="5" style="background:#F8F8F8;font-size:small;text-align:left" | '''Notes''' :a.{{note|GB18030-PUA-blue}}<span style="background:#ccf; padding:0 0.2em;">Blue</span> indicates private use area :b.{{note|GB18030-2022-1}}{{unichar|20087}} mapped to <code>0x95329031</code> in GB 18030-2022 :c.{{note|GB18030-2022-2}}{{unichar|20089}} mapped to <code>0x95329033</code> in GB 18030-2022 :d.{{note|GB18030-2022-3}}{{unichar|200CC}} mapped to <code>0x95329730</code> in GB 18030-2022 :e.{{note|GB18030-2022-4}}{{unichar|215D7}} mapped to <code>0x9536B937</code> in GB 18030-2022 :f.{{note|GB18030-2022-5}}{{unichar|2298F}} mapped to <code>0x9630BA35</code> in GB 18030-2022 :g.{{note|GB18030-2022-6}}{{unichar|241FE}} mapped to <code>0x9635B630</code> in GB 18030-2022 |}
== As a national standard == The first version of GB 18030, designated GB 18030-2000 ''Information Technology—Chinese coded character set for information interchange — Extension for the basic set'', consists of 1-byte and 2-byte encodings, together with 4-byte encoding for CJK Unified Ideographs Extension A matching those in Unicode 3.0. The corresponding Unicode code points of this subset, including provisional private assignments, lie entirely in the BMP. These parts are fully mandatory in GB 18030-2000.<ref name="CESI-FAQ"/>{{rp|2}} Most major computer companies had already standardized on some version of Unicode as the primary format for use in their binary formats and OS calls. However, they mostly had only supported code points in the BMP originally defined in Unicode 1.0, which supported only 65,536 codepoints and was often encoded in 16 bits as UCS-2. This standard is basically an extension based on GBK with additional characters in CJK Unified Ideographs Extension A.
The second version designated GB 18030-2005 ''Information Technology—Chinese coded character set'' has the same mandatory subset as GB 18030-2000 of 1-, 2- and 4-byte encodings.<ref name="gb18030-2005" />{{rp|3}} This version also includes the full CJK Unified Ideographs Extension B in the 4-byte encoding section which is outside the BMP<ref name="Lunde2006" /> as a suggestion support requirement.<ref>{{cite web |last=CESI |authorlink=China Electronics Standardization Institute |date=2009-07-08 |title=GB18030 符合性问与答 |trans-title=GB18030 compliance FAQ |url=http://www.cc.cesi.cn/UpLoadFolder/OtherFile/200907/2009070816133686.doc |archive-url=https://web.archive.org/web/20160928145226/http://www.cc.cesi.cn/UpLoadFolder/OtherFile/200907/2009070816133686.doc |archive-date=2016-09-28 |access-date=2016-10-12 |website=CESI Certification Center |publisher= |quote=''Page 4'' 同时达到以下两个要求的产品,为符合GB 18030-2005强制部分的产品:①产品可以正确输入、输出、处理GB 18030-2005强制部分规定的全部汉字字符;②产品可以正确识别GB 18030-2005强制性部分规定的全部汉字字符对应的编码。 [A product compliant with the mandatory part of GB 18030 must be able to correctly a) input, output and process all Chinese characters defined in the mandatory set; b) recognize encodings for characters in the mandatory set.]}}</ref> However, as the inclusion of CJK Unified Ideographs Extension B in a 4-byte region is required to be maintained during information processing, software can no longer get away with treating characters as 16-bit fixed width entities (UCS-2). Therefore, they must either process the data as a variable-width format (as with UTF-8 or UTF-16), which is the most common choice, or move to a larger fixed-width format (i.e. UTF-32). Microsoft made the change from UCS-2 to UTF-16 with Windows 2000. This version matches with Unicode 3.1, and also provided support for Hangul (Korean), Mongolian (including Manchu, Clear script, ''Sibe hergen'', Galik), Tai Nuea, Tibetan, Uyghur/Kazakh/Kyrgyz and Yi.
The third and latest version, GB 18030-2022 ''Information Technology—Chinese coded character set'', mandates the suggestion support part of CJK Unified Ideographs Extension B in GB 18030-2005, along with updates up to Unicode 11.0 including Kangxi Radicals and CJK Unified Ideographs URO, Extension C, D, E and F. Additional languages are also recognized by GB 18030-2022 such as part of Arabic, Tai Le, New Tai Lue, Tai Tham, Lisu, and Miao. GB 18030-2022 also introduces three implementation levels, with the requirement of "all products using this standard should implements Implementation Level 1" that includes 66 new BMP characters in the 4-byte encoding region that were added between Unicode 3.1 and Unicode 11.0. Implementation Level 2 requires the support of ''List of Commonly Used Standard Chinese Characters'', and Implementation Level 3 requires all other specified regions in the standard.<ref name="gb18030-2022-kenlunde" />
{{Main|CJK Unified Ideographs Extension I}}
From late 2022 to 2023, drafts of a further amendment are to be made to GB 18030-2022 available for public consultation. The current draft updates up to Unicode 15.1 on Ideographic Description Characters, CJK Unified Ideographs URO, Extension A, B, C, G, H and I.<ref>{{Cite web |last=Lunde |first=Dr Ken |date=2023-11-12 |title=The First Amendment |url=https://ken-lunde.medium.com/the-first-amendment-fe064d9d7d8 |access-date=2024-09-09 |website=Medium |language=en}}</ref><ref>{{Cite web |title=GB 18030—2022《信息技术 中文编码字符集》国家标准第1号修改单(征求意见稿) |url=https://www.unicode.org/L2/L2023/23113-gb18030-2022-amd-draft1.pdf |id=UTC L2/23-113 |date= 2023-04-26 |author=China National Body}}</ref><ref name="irgn2623">{{cite web |author=China National Body |date=2023-10-13 |title=IRG #61 Activity Report |url=https://www.unicode.org/L2/L2023/23240-irgn2623-china-ar.pdf |id=ISO/IEC JTC1/SC2/WG2/IRG N2623; UTC L2/23-240}}</ref> Originally, in late 2022, it would have placed 897 new sinographic characters in Plane 10 (hexadecimal: 0A), a yet-untitled astral Unicode plane, for citizen real-name certification in China, but eventually the repertoire (reduced to 622 characters after expert review) was fast-tracked into Unicode 15.1 in September 2023, as the CJK Unified Ideographs Extension I block.<ref name="wg2-n5222">{{Cite web |author=United States National Body |date=May 1, 2023 |title=USNB Comments on Draft 2 of GB 18030-2022 Amendment 1 and recommendation for ISO/IEC 10646:2020 Amendment 2 |url=https://www.unicode.org/wg2/docs/n5222_USNB-Comments-on-Draft-2-of-GB%2018030-2022-Amendment-1.pdf |id=ISO/IEC JTC1/SC2 N4852, WG2 N5222; UTC L2/23-115}}</ref> Following this, the amendment draft was modified to use the Extension I code points.<ref name="irgn2623" />
== Mapping {{anchor|Technical_details}} == GB 18030 defines a one (ASCII), two (extended GBK), or four-byte (UTF) encoding. The two-byte codes are defined in a lookup table, while the four-byte codes are defined sequentially (hence algorithmically) to fill otherwise unencoded parts in UCS. GB 18030 inherits the bad aspects of GBK, most notably needing special code to safely find ASCII characters in a GB18030 sequence.
{| {{Table}} |+ GB 18030 encoding<ref name="gb18030-2005"/>{{rp|3}}<ref name="gb18030-2000"/>{{rp|252}}<ref name=ICU>[http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml Authoritative mapping table between GB18030-2000 and Unicode]. ICU{{snd}} International Components for Unicode. 2001-02-21. Accessed 2016-09-04.</ref> |- ! colspan=4 | GB 18030 ! rowspan=2 | code points{{efn|The code points include the 66 Unicode noncharacters.}} ! rowspan=2 | Unicode |- ! byte 1 (MSB) !! byte 2 !! byte 3 !! byte 4 |- | {{code|00}} – {{code|7F}} ! colspan=3 | | style="text-align: right" | 128 | {{code|0000}} – {{code|007F}} |- | {{code|80}} ! colspan=3 | | — | invalid{{efn|name=icu-80-glitch|ICU seems to erroneously consider this code point valid, which is in neither versions of the published standards. WHATWG assigns this byte to U+20AC (GBK euro sign) in its universal gb2312-gbk-gb18030 decoder.}} |- | {{code|81}} – {{code|FE}} || {{code|40}} – {{code|FE}} except {{code|7F}}{{efn|For a finer division of this range, see {{slink|GBK (character encoding)#Encoding}}.}} ! colspan=2 | | style="text-align: right" | {{val|23940}} | rowspan=2 | {{code|0080}} – {{code|FFFF}} except {{code|D800}} – {{code|DFFF}}{{efn|Some code points are encoded with two bytes (upper row), the others with four bytes (lower row). U+FFFF is encoded as {{code|84 31 A4 39}} on page 239 of the 2005 standard, although the standard gives as far as {{code|84 39 FE 39}} for BMP mapping.}} |- | {{code|81}} – {{code|84}} | rowspan=3 | {{code|30}} – {{code|39}} | rowspan=3 | {{code|81}} – {{code|FE}} | rowspan=3 | {{code|30}} – {{code|39}} | style="text-align: right" | {{val|39420}} |- | {{code|85}} | — ({{val|12600}}) | ''reserved for future character extension'' |- | {{code|86}} – {{code|8F}} | — ({{val|126000}}) | ''reserved for future ideographic extension'' |- | colspan=4 | unassigned | — | {{code|D800}} – {{code|DFFF}}{{efn|These are surrogate code points; they have no meaning outside of UTF-16 encoding.}} |- | {{code|90}} – {{code|E3}} | rowspan=3 | {{code|30}} – {{code|39}} | rowspan=3 | {{code|81}} – {{code|FE}} | rowspan=3 | {{code|30}} – {{code|39}} | style="text-align: right" | {{val|1048576}} | <code>{{digit groups|1|0000}}</code> – <code>{{digit groups|10|FFFF}}</code> |- | {{code|E4}} – {{code|FC}} | — ({{val|315000}}) | ''reserved for future standard extension'' |- | {{code|FD}} – {{code|FE}} | — ({{val|25200}}) | ''user-defined'' |- | {{code|FF}} ! colspan=3 | | — | invalid |- ! colspan=4 style="text-align: right" | Total ! style="text-align: right" | {{val|1112064}} ! |}
The one- and two-byte code points are essentially GBK with the euro sign, PUA mappings for unassigned/user-defined points, and vertical punctuations. The four byte scheme can be thought of as consisting of two units, each of two bytes. Each unit has a similar format to a GBK two byte character but with a range of values for the second byte of 0x30–0x39 (the ASCII codes for decimal digits). The first byte has the range 0x81 to 0xFE, as before. This means that a string-search routine that is safe for GBK should also be reasonably{{clarify|date=November 2022}} safe for GB18030 (in much the same way that a basic byte-oriented search routine is reasonably safe for EUC).
This gives a total of 1,587,600 (126×10×126×10) possible 4-byte sequences, which is easily sufficient to cover Unicode's 1,112,064 (17×65536 − 2048 surrogates) assigned, reserved, and noncharacter code points.
Unfortunately, to further complicate matters there are no simple rules to translate between a 4-byte sequence and its corresponding code point. Instead, codes are allocated sequentially (with the first byte containing the most significant part and the last the least significant part) '''only''' to Unicode code points that are not mapped in any other manner.{{efn|Furthermore, due to the encodings of U+E7C7 and U+1E3F having been swapped, U+E7C7 is encoded in the 2005 edition of the standard as 81 35 F4 37, between U+1E3E (81 35 F4 36) and U+1E40 (81 35 F4 38). Hence, only the 2000 edition is entirely sequential in allocating the four-byte codes to otherwise unmapped code points.}} For example:
U+00DE (Þ) → 81 30 89 37 U+00DF (ß) → 81 30 89 38 U+00E0 (à) → A8 A4 U+00E1 (á) → A8 A2 U+00E2 (â) → 81 30 89 39 U+00E3 (ã) → 81 30 8A 30
An offset table is used in the WHATWG and W3C version of GB 18030 to efficiently translate code points.<ref name=whatwg>{{cite web|title=Encoding Standard # gb18030-index|url=https://encoding.spec.whatwg.org/#index-gb18030-ranges-pointer|website=WHATWG|access-date=2016-09-24}}</ref> ICU<ref name=ICU/> and glibc use similar range definitions to avoid wasting space on large sequential blocks.
== Support == {{Anchor|Windows support}} {{Expand section||date=October 2016}}
=== Encoding === GB{{nbsp}}18030 has been supported on Windows since the release of Windows 95, as code page 54936.<ref>{{Cite web |first=Karl |last=Bridge |title=MultiByteToWideChar function (stringapiset.h) - Win32 apps |url=https://learn.microsoft.com/en-us/windows/win32/api/stringapiset/nf-stringapiset-multibytetowidechar |date=13 October 2021 |access-date=2022-11-01 |website=learn.microsoft.com |language=en-us}}</ref> Windows 2000 and XP offer a GB18030 Support Package.<ref>{{cite web|title=GB18030 Support Package|author=Microsoft|website=Microsoft|url=https://www.microsoft.com/downloads/details.aspx?FamilyID=fc02e2e3-14bb-46c1-afee-3732d6249647&DisplayLang=en|archive-url=https://web.archive.org/web/20120605011449/https://www.microsoft.com/en-us/download/details.aspx?id=5503|archive-date=2012-06-05|url-status=dead}}</ref> The open source PostgreSQL database supports GB18030 through its full support for UTF-8, i.e. by converting it to and from UTF-8. Similarly Microsoft SQL Server supports GB18030 by conversion to and from UTF-16.
More specifically, supporting the GB18030 encoding on Windows means that '''Code Page 54936''' is supported by <code>MultiByteToWideChar</code> and <code>WideCharToMultiByte</code>. Due to the backward compatibility of the mapping, many files in GB18030 can be actually opened successfully as the legacy Code Page 936, that is GBK, even if the Code Page 54936 is not supported. However, that is only true if the file in question contains only GBK characters. Loading will fail or cause corrupted result if the file contains characters that do not exist in GBK (see {{slink|#Mapping}} for examples).
GNU glibc's gconv, the character codec library used on most Linux distributions, supports GB 18030-2000 since 2.2,<ref>{{cite web|last1=Drepper|first1=Ulrich|title=GB18030 iconv module for glibc.|url=https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=bc0413276ea17dc2a255ce726e9b9a504438980f|website=glibc git|access-date=29 November 2016}}</ref> and GB 18030-2005 since 2.14;<ref>{{cite web|last1=Drepper|first1=Ulrich|title=Update GB18030 to 2005 version|url=https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commit;h=ee30c380b8f7c9253c87103c58c5201268d30181|website=glibc git|access-date=29 November 2016}}</ref> glibc notably includes non-PUA mappings for GB 18030-2005 in order to achieve round-trip conversion.<ref>{{cite web|last1=Weimer|first1=Florian|last2=O'Donell|first2=Carlos|title=Status of GB18030 tables (#19575)|url=https://sourceware.org/bugzilla/show_bug.cgi?id=19575|website=Sourceware Bugzilla|access-date=29 November 2016}}</ref> GNU libiconv, an alternative iconv implementation frequently used on non-glibc UNIX-like environments like Cygwin, supports GB 18030 since version 1.4.<ref>{{cite web|url=https://git.savannah.gnu.org/cgit/libiconv.git/tree/NEWS?id=v1.14|title=NEWS - libiconv.git - libiconv|website=git.savannah.gnu.org|access-date=2016-10-13}}</ref>
As of 2022, "supporting non-Chinese scripts continues to be optional"<ref name="non-Chinese">{{Cite web |last=Lunde |first=Ken |date=2022-08-16 |title=The GB 18030-2022 Standard |url=https://ken-lunde.medium.com/the-gb-18030-2022-standard-3d0ebaeb4132 |access-date=2022-11-01 |website=Medium |language=en}}</ref> (presumably for display/font support only; and in China, since the encoding is a full UTF). The standard is known to support English/ASCII and the "following non-Chinese scripts are recognized by GB 18030-2022: Arabic, Tibetan, Mongolian, Tai Le, New Tai Lue, Tai Tham, Yi, Lisu, Hangul (Korean), and Miao."<ref name="non-Chinese" />
=== Fonts === The GB18030 Support Package for Windows XP and Windows 2000 contained SimSun18030.ttc, a TrueType font collection file which combines two Chinese fonts, SimSun-18030 and NSimSun-18030. The SimSun-18030 font included all the mandatory CJK characters required in GB18030-2000, including characters in the CJK Unified Ideographs and CJK Unified Ideographs Extension A blocks of Unicode 3.0. Since Windows Vista, Windows has included the Simsun and Simsun-ExtB fonts. (Simsun supports CJK characters in the Unicode Basic Multilingual Plane, while Simsun-ExtB supports most CJK characters in the Unicode Supplementary Ideographic Plane). These fonts have been updated in subsequent Windows releases to support additional CJK characters. As of 2022, the Simsun-ExtB font supported CJK Unified Ideograph Extension B, Extension C and Extension D. For GB 18030-2022, the Simsun-ExtB font was updated to add support for CJK Unified Ideograph Extension E and Extension F.<ref name="KB5028171"/> Also, the Simsun-ExtG font was added to Windows 10 and Windows 11 to support CJK characters in CJK Unified Ideographs Extension G, Extension H and Extension I.<ref>{{cite web |author=<!-- not stated --> |date=11 February 2025 |title=KB5051987: New Features and Fixes for Enhanced Windows Experience |url=https://windowsforum.com/threads/kb5051987-new-features-and-fixes-for-enhanced-windows-experience.351824/ |website=windowsforum.com |access-date=31 July 2025}}</ref><ref>{{cite web |author=<!-- not stated --> |date=11 February 2025 |title=February 11, 2025—KB5051987 (OS Build 26100.3194) |url=https://support.microsoft.com/en-us/topic/february-11-2025-kb5051987-os-build-26100-3194-63fb007d-3f52-4b47-85ea-28414a24be2d |website=support.microsoft.com |publisher=Microsoft |access-date=31 July 2025}}</ref> The Simsun fonts in Windows 10 and Windows 11 support all CJK characters required for GB18030-2022 plus Amendment 1 level 3 conformance.
Microsoft YaHei and DengXian provided by Microsoft were updated in 2023 to match GB 18030-2022 implementation level 2.<ref name="KB5028171">{{cite web |title=July 11, 2023—KB5028171 (OS Build 20348.1850) - Microsoft Support |url=https://support.microsoft.com/en-us/topic/july-11-2023-kb5028171-os-build-20348-1850-65cc2bda-a4a5-450f-adcb-d57ff9eb9835 |website=support.microsoft.com |publisher=Microsoft |access-date=25 March 2024}}</ref>
Source Han Sans (and its counterpart Noto Sans CJK) are already compliant with GB 18030-2022 implementation level 2 when the standard update for GB 18030 is announced {{as of|November 2022|lc=on}}. Source Han Serif (and its counterpart Noto Serif CJK) however is not compliant at the time, and an update is provided to ensure the font is compliant to implementation level 2. Similarly Microsoft YaHei and PingFang (Apple) require a small number of URO additions that are associated with implementation level 1 in order to become compliant with GB 18030-2022 implementation level 2.<ref name="non-Chinese" />
Other CJK font families like HAN NOM<ref>{{cite web|url=https://sourceforge.net/projects/vietunicode/files/hannom/|title=/hannom|last=VietUnicode|website=sourceforge.net|access-date=2016-10-13}}</ref> and Hanazono Mincho<ref>{{cite web|url=http://fonts.jp/hanazono/|title=Hanazono fonts|website=fonts.jp|access-date=2016-10-13|archive-date=2010-04-12|archive-url=https://web.archive.org/web/20100412205922/http://fonts.jp/hanazono/|url-status=dead}}</ref> provide wider coverage for Unicode CJK Extension blocks than SimSun-18030 or even SimSun (Founder Extended), but they don't support all code points defined in GB 18030.
== See also == * Guobiao code * CJK characters * Chinese character encoding * Comparison of Unicode encodings
== Notes == {{Notelist}}
== References == {{Reflist}}
== External links == *[https://www.iana.org/assignments/charset-reg/GB18030 IANA Charset Registration for GB18030] *{{cite web |url=https://examples.oreilly.com/cjkvinfo/pdf/GB18030_Summary.pdf |title=English language summary of {{snd}} -2000 |archive-url=https://web.archive.org/web/20170202093140/https://examples.oreilly.com/cjkvinfo/pdf/GB18030_Summary.pdf |archive-date=2017-02-02 |date=February 16, 2001}} *[https://web.archive.org/web/20120825155118/https://developers.sun.com/dev/gadc/technicalpublications/articles/gb18030.html Introduction to GB18030 including evolution from GB2312 and GBK] (Sun/Internet Archive) *ICU data<!-- No lookbehind for these notes?{{efn|name=icu-80-glitch}} --> **[http://icu-project.org/docs/papers/gb18030.html GB18030: A mega-codepage] (IBM DeveloperWorks) **[http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml Authoritative mapping table between GB18030-2000 and Unicode] **[http://demo.icu-project.org/icu-bin/convexp?conv=gb18030 ICU Converter Explorer: GB18030] *Unicode charts **[https://www.unicode.org/charts/PDF/U3400.pdf Unicode CJK Unified Ideographs Extension A] (PDF, 1.5 MB) **[https://www.unicode.org/charts/PDF/U20000.pdf Unicode CJK Unified Ideographs Extension B] (PDF, 13 MB) *[https://web.archive.org/web/20120405111548/https://www.microsoft.com/download/en/details.aspx?DisplayLang=en&id=5503 GB18030 Support Package for Windows 2000/XP, including Chinese, Tibetan, Yi, Mongolian and Thai font by Microsoft] (Internet Archive) *[https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id= SIL's freeware fonts, editors and documentation]
{{CJK computing}} {{Character encoding}} {{Unicode navigation}}
{{DEFAULTSORT:Gb 18030}} 18030 Category:Unicode Transformation Formats Category:Chinese character encodings