GBK (character encoding)

Simplified Chinese character encoding

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "GBK" character encoding – news · newspapers · books · scholar · JSTOR (October 2016) (Learn how and when to remove this message)

|

Guójiā Biāozhǔn Kuòzhǎn (GBK)

Layout of GBK (see below for a larger copy of this diagram)

MIME / IANA| GBK
Alias(es)| CP936, MS936, windows-936, csGBK
Language(s)| Web browsers, decode as GB 18030, supporting all languages, while the encoding (and other software decoders) is primarily used for Simplified Chinese, but also supports Traditional Chinese, Japanese, English, Russian and (partially) Greek.
Standard| GBK 1.0
Classification| Extended ASCII,[a] variable-width encoding, CJK encoding
Extends| EUC-CN
Preceded by| GB 2312
Succeeded by| GB 18030

1. ^ Not in the strictest sense of the term, as ASCII bytes can appear as trail bytes.

GBK is an extension of the GB 2312 character set for Simplified Chinese characters, used in the People's Republic of China. It includes all unified CJK characters found in GB 13000.1-93, i.e. ISO/IEC 10646:1993, or Unicode 1.1. Since its initial release in 1993, GBK has been extended by Microsoft in Code page 936/1386, which was then extended into GBK 1.0. GBK is also the IANA-registered internet name for the Microsoft mapping,[1] which differs from other implementations primarily by the single-byte euro sign at 0x80.

GB abbreviates Guójiā Biāozhǔn, which means national standard in Chinese, while K stands for Extension (扩展 kuòzhǎn). GBK not only extended the old standard GB 2312 with Traditional Chinese characters, but also with Chinese characters that were simplified after the establishment of GB 2312 in 1981. With the arrival of GBK, certain names with characters formerly unrepresentable, like the 镕 (róng) character in former Chinese Premier Zhu Rongji's name, are now representable.[2]

As of October 2022[update], GBK is the third-most popular encoding served from China and territories (after UTF-8 and the subset GB 2312), with 1.9% of web servers serving a page that declares GBK.[3] However, all major web browsers decode GB2312-marked documents as if they were marked GBK, except for Safari and Edge on the label `GB_2312`.[4] Together, GBK and GB 2312 encodings have a combined 5.5% presence in China and territories.[3] Globally, GBK accounts for less than 0.07% of all web pages and GBK+GB2312 for 0.2%.[5]

## History

[edit]

In 1993, the Unicode 1.1 standard was released, including 20,902 characters used in mainland China, Taiwan, Japan and Korea. Following this, China released GB 13000.1-93, the Guobiao standard equivalent of Unicode 1.1.

The GBK character set was defined in 1993 as an extension of GB 2312-80, while also including the characters of GB 13000.1-93 through the unused codepoints available in GB 2312. Hence GBK is backward compatible with GB 2312. GBK was defined in a normative annex to GB 13000.1-93.[6]

Microsoft implemented GBK in Windows 95 and Windows NT 3.51 as Code Page 936. While GBK was never an official standard, widespread usage of Windows 95 led to GBK becoming the de facto standard. While GBK included all the Chinese characters defined in Unicode 1.1 and GB 13000.1-93, these standards used different code tables. The primary reason for its existence was simply to bridge the gap between GB 2312-80 and GB 13000.1-93.

In 1995, China National Information Technology Standardization Technical Committee set down the Chinese Internal Code Extension Specification (Chinese: 汉字内码扩展规范 (GBK); pinyin: Hànzì Nèimǎ Kuòzhǎn Guīfàn (GBK)), Version 1.0, known as GBK 1.0, which is a slight extension of Codepage 936. The newly added 95 characters were not found in GB 13000.1-1993, and were provisionally assigned Unicode PUA code points.[7]: 534

Microsoft later added the euro sign to Code page 936 and assigned the code 0x80 to it. This is not a valid code point in GBK 1.0.

In 2000, the GB 18030-2000 standard was released, superseding yet maintaining compatibility with GBK 1.0. It increased the number of definitions of Chinese characters and extended the number of possible characters through the implementation of four-byte character spaces. The subset of GB 18030 consisting of one-byte and two-byte characters is sometimes also referred to as GBK. Mapping to Unicode has been slightly changed, though, as some characters are now defined in Unicode. In the most up-to-date form of the standard, GB 18030-2005, only 24[8] characters are still mapped to Unicode PUA (see GB 18030#PUA.)

In 2002, GBK was registered as an IANA charset; the registration uses code page 936 mapping as well as CP936/MS936 aliases, but refers to GBK 1.0 specification.[1] W3C's technical recommendation published in 2015[9] defines a GBK encoder as a GB 18030 encoder with a single-byte euro sign and without four-byte sequences (while W3C's GBK decoder specification has no such limitation, decodes as GB 18030, i.e. with same range of letters as all of Unicode).

## Encoding

[edit]

A character is encoded as 1 or 2 bytes. A byte in the range `00`–`7F` is a single byte that means the same thing as it does in ASCII. Strictly speaking, there are 95 characters and 33 control codes in this range.

A byte with the high bit set indicates that it is the first of 2 bytes. Loosely speaking, the first byte is in the range `81`–`FE` (that is, never `80` or `FF`), and the second byte is `40`–`A0` except `7F` for some areas and `A1`–`FE` for others.

More specifically, the following ranges of bytes are defined:

GBK Encoding Ranges  range | byte 1 | byte 2 | code points | characters

|
|
|
|

GB 18030 | GBK 1.0 | Codepage 936 | GB 2312
Level GBK/1 | `A1`–`A9` | `A1`–`FE` | 846 | 718[7]: 8–10 | 717 | 715 | 682
Level GBK/2 | `B0`–`F7` | `A1`–`FE` | 6,768 | 6,763 | 6,763 | 6,763
Level GBK/3 | `81`–`A0` | `40`–`FE` except `7F` | 6,080 | 6,080 | 6,080 |
Level GBK/4 | `AA`–`FE` | `40`–`A0` except `7F` | 8,160 | 8,160 | 8,080
Level GBK/5 | `A8`–`A9` | `40`–`A0` except `7F` | 192 | 166 | 153
user-defined 1[7] | `AA`–`AF` | `A1`–`FE` | 564 |
user-defined 2 | `F8`–`FE` | `A1`–`FE` | 658
user-defined 3 | `A1`–`A7` | `40`–`A0` except `7F` | 672
total: |  |  | 23,940 | 21,887 | 21,886 | 21,791 | 7,445

### Layout diagram

[edit]

In graphical form, the following figure shows the space of all 64K possible 2-byte codes. Green and yellow areas are assigned GBK codepoints, red are for user-defined characters. The uncolored areas are invalid byte combinations.

## Relationship to other encodings

[edit]

The areas indicated in the previous section as GBK/1 and GBK/2, taken by themselves, is simply GB 2312-80 in its usual encoding, GBK/1 being the non-hanzi region and GBK/2 the hanzi region. GB 2312, or more properly the EUC-CN encoding thereof, takes a pair of bytes from the range `A1`–`FE`, like any 94² ISO-2022 character set loaded into GR. This corresponds to the lower-right quarter of the illustration above. However, GB 2312 does not assign any code points to the rows located at `AA`–`B0` and `F8`–`FE`, even though it had staked out the territory. GBK added extensions to these rows. You can see that the two gaps were filled in with user-defined areas.

More significantly, GBK extended the range of the bytes. Having two-byte characters in the ISO-2022 GR range gives a limit of 94²=8,836 possibilities. Abandoning the ISO-2022 model of strict regions for graphics and control characters, but retaining the feature of low bytes being 1-byte characters and pairs of high bytes denoting a character, you could potentially have 128²=16,384 positions. GBK takes part of that, extending the range from `A1`–`FE` (94 choices for each byte) to `81`–`FE` (126 choices) for the first byte and `40`–`FE` (191 choices) for the second byte, for a total of 24,066 positions.

Microsoft's Code Page 936 is generally thought of as being GBK.[1] However, the 95 PUA characters added in GBK 1.0 are not included in Code Page 936. Code Page 936 also has a single-byte euro sign at 0x80 which GBK 1.0 doesn't have.[10]

GBK's successor, GB 18030-2000, uses the remaining range available to the second byte (`30`-`39`) to further expand the number of possibilities while retaining GBK as a subset.

## References

[edit]

1. ^ a b c "Character Sets". Retrieved 3 October 2016.
2. ^ "Code Page 936 - PRC GBK (XGB)". Microsoft. Archived from the original on 2002-10-01. Conversion map between Codepage 936 and Unicode. Need manually selecting GB 18030 or GBK in browser to view it correctly.
3. ^ a b "Distribution of Character Encodings among websites that use China and territories". w3techs.com. Retrieved 2022-10-25.
4. ^ "Encoding: Summarized test results". www.w3.org. Retrieved 2019-11-15.
5. ^ "Historical trends in the usage statistics of character encodings for websites, October 2022". w3techs.com. Retrieved 2022-10-25.
6. ^ "18.2: Ideographic Description Characters" (PDF). The Unicode Standard. Version 15.0.0. 2022. p. 763\. "The Ideographic Description characters are found in GBK—an extension to GB 2312-80 that added all 20,902 Unicode Version 1.1 ideographs not already in GB 2312-80. GBK is defined as a normative annex of GB 13000.1-93."
7. ^ a b c Standardization Administration of China (SAC) (2005-11-18). GB 18030-2005: Information Technology—Chinese coded character set.
8. ^ GB 18030-2005 Standard p.9, 79
9. ^ "Encoding Standard # gbk-encoder". W3C. Retrieved 2016-10-02.
10. ^ Scherer, Markus (4 January 2002). "Re: Fun with GBK & GB2312". Unicode Mail List Archive. Retrieved 4 March 2020.

## Notes

[edit]

## External links

[edit]

* A scan of the GBK 1.0 specification provided by the Ideographic Research Group
* ICU's Authoritative GBK mapping \- part of GB18030 data Archived 2016-10-31 at the Wayback Machine
* Microsoft Reference page for GBK
* Mapping of GBK to Unicode  N.B.: this is Microsoft code page 936, which contains entries for 21791 double-byte code points, 96 single-byte graphic characters, and 33 control characters. This is not exactly the same as GBK which has 21886 characters.
* GBK Code Table N.B. This gbk-encoded page shows the available coding space totally populated except for 2 places, for a total of 32256 glyphs (32352 with the implied single-byte ASCII codes not illustrated), which is more than 23940 or 21886. Actual rendering of this table depends on your browser's GBK decoder.

* v
* t
* e

Chinese, Japanese and Korean computing

Encodings|

| Chinese|

* ISO-2022-CN
* CNS 11643
* Big5
* HKSCS
* GB 18030
* GBK
* GB 2312
* GB/T 12345
* HZ
* ISO-IR-165
* CCCII

|

Japanese|

* ISO-2022-JP
* JIS
* JIS X 0201
* JIS X 0208
* JIS X 0212
* JIS X 0213
* Shift-JIS

Korean|

* ISO-2022-KR
* KS X 1001
* KS X 1002
* KPS 9566
* GB 12052

International|

* EUC
* ISO/IEC 2022
* Unicode
* CJK Unified Ideographs
* Han unification

Input methods|

* Chinese
* Japanese
* Korean

Fonts|

* List of CJK fonts

* v
* t
* e

Character encodings

Early telecommunications|

* Telegraph code
* Needle
* Morse
* Non-Latin
* Wabun/Kana
* Chinese
* Cyrillic
* Baudot and Murray
* Fieldata
* ASCII
* ISO/IEC 646
* BCDIC
* Teletex and Videotex/Teletext
* T.51/ISO/IEC 6937
* ITU T.61
* ITU T.101
* World System Teletext
* background
* sets
* Transcode

ISO/IEC 8859|

* Approved parts
* -1 (Western Europe)
* -2 (Central Europe)
* -3 (Maltese/Esperanto)
* -4 (North Europe)
* -5 (Cyrillic)
* -6 (Arabic)
* -7 (Greek)
* -8 (Hebrew)
* -9 (Turkish)
* -10 (Nordic)
* -11 (Thai)
* -13 (Baltic)
* -14 (Celtic)
* -15 (New Western Europe)
* -16 (Romanian)
* Abandoned parts
* -12 (Devanagari)
* Proposed but not approved
* KOI-8 Cyrillic
* Sámi
* Adaptations
* Welsh
* Estonian
* Ukrainian Cyrillic

Bibliographic use|

* MARC-8
* ANSEL
* CCCII/EACC
* ISO 5426
* 5426-2
* 5427
* 5428
* 6438
* 6862

National standards|

* ArmSCII
* Big5
* BraSCII
* BSCII
* CNS 11643
* DIN 66003
* ELOT 927
* GOST 10859
* GB 2312
* GB 12345
* GB 12052
* GB 18030
* HKSCS
* ISCII
* JIS X 0201
* JIS X 0208
* JIS X 0212
* JIS X 0213
* KOI-7
* KPS 9566
* KS X 1001
* KS X 1002
* LST 1564
* LST 1590-4
* PASCII
* Shift JIS
* SI 960
* TIS-620
* TSCII
* VISCII
* VSCII
* YUSCII

ISO/IEC 2022|

* ISO/IEC 8859
* ISO/IEC 10367
* Extended Unix Code / EUC

Mac OS Code pages
("scripts")|

* Armenian
* Arabic
* Barents Cyrillic
* Celtic
* Central European
* Croatian
* Cyrillic
* Devanagari
* Farsi (Persian)
* Font X (Kermit)
* Gaelic
* Georgian
* Greek
* Gujarati
* Gurmukhi
* Hebrew
* Iceland
* Inuit
* Keyboard
* Latin (Kermit)
* Maltese/Esperanto
* Ogham
* Roman
* Romanian
* Sámi
* Turkish
* Turkic Cyrillic
* Ukrainian
* VT100

DOS code pages|

* 437
* 737
* 850
* 858
* 861
* 862
* 863
* 864
* 865
* 866
* 867
* 868
* 869
* 899
* 904
* 932
* 936
* 942
* 949
* 950
* 951
* 1040
* 1043
* 1046
* 1098
* 1115
* 1116
* 1117
* 1118
* 1127
* ABICOMP
* CS Indic
* CSX Indic
* CSX+ Indic
* CWI-2
* Iran System
* Kamenický
* Mazovia
* MIK

IBM AIX code pages|

* 895
* 896
* 912
* 915
* 921
* 922
* 1006
* 1008
* 1009
* 1010
* 1012
* 1013
* 1014
* 1015
* 1016
* 1017
* 1018
* 1019
* 1046
* 1133

Windows code pages|

* CER-GS
* 932
* 936 (GBK)
* 950
* Extended Latin-8
* 1250
* 1251
* 1252
* 1253
* 1254
* 1255
* 1256
* 1257
* 1258
* 1270
* Cyrillic + French
* Cyrillic + German
* Polytonic Greek

EBCDIC code pages|

* Japanese language in EBCDIC
* DKOI

DEC terminals (VTx)|

* Multinational (MCS)
* National Replacement (NRCS)
* French Canadian
* Swiss
* Spanish
* United Kingdom
* Dutch
* Finnish
* French
* Norwegian and Danish
* Swedish
* Norwegian and Danish (alternative)
* 8-bit Greek
* 8-bit Turkish
* SI 960
* Hebrew
* Special Graphics
* Technical (TCS)

Platform specific|

* 1052
* 1053
* 1054
* 1055
* 1058
* Acorn RISC OS
* Amstrad CPC
* Apple II
* ATASCII
* Atari ST
* BICS
* Casio calculators
* CDC
* Compucolor 8001
* Compucolor II
* CP/M+
* DEC RADIX 50
* DEC MCS/NRCS
* DG International
* Galaksija
* GEM
* GSM 03.38
* HP Roman
* HP FOCAL
* HP RPL
* SQUOZE
* LICS
* LMBCS
* MSX
* NEC APC
* NeXT
* PETSCII
* PostScript Standard
* PostScript Latin 1
* SAM Coupé
* Sega SC-3000
* Sharp calculators
* Sharp MZ
* Sinclair QL
* Teletext
* TI calculators
* TRS-80
* Ventura International
* WISCII
* XCCS
* ZX80
* ZX81
* ZX Spectrum

Unicode / ISO/IEC 10646|

* UTF-1
* UTF-7
* UTF-8
* UTF-16
* UTF-32
* UTF-EBCDIC
* GB 18030
* DIN 91379
* BOCU-1
* CESU-8
* SCSU
* TACE16
* Comparison of Unicode encodings

TeX typesetting system|

* Cork
* LY1
* OML
* OMS
* OT1

Miscellaneous code pages|

* ABICOMP
* ASMO 449
* Digital encoding of APL symbols
* ISO-IR-68
* ARIB STD-B24
* Fieldata
* HZ
* IEC-P27-1
* INIS
* 7-bit
* 8-bit
* ISO-IR-169
* ISO 2033
* KOI
* KOI8-R
* KOI8-RU
* KOI8-U
* Mojikyō
* SEASCII
* Stanford/ITS
* Symbol
* TRON
* Unified Hangul Code

Control character|

* Morse prosigns
* C0 and C1 control codes
* ISO/IEC 6429
* JIS X 0211
* Unicode control, format and separator characters
* Whitespace characters

Related topics|

* CCSID
* Character encodings in HTML
* Charset detection
* Han unification
* Hardware code page
* MICR code
* Mojibake
* Variable-length encoding

Character sets
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template