GB/T 2312-1980 was originally a mandatory national standard designated GB 2312-1980. However, following a National Standard Bulletin of the People's Republic of China in 2017, GB 2312 is no longer mandatory, and its standard code is modified to GB/T 2312-1980.[2]GB/T 2312-1980 has been superseded by GBK and GB 18030, which include additional characters, but GB/T 2312 remains in widespread use as a subset of those encodings.
As of September 2022[update], GB2312 is the second-most popular encoding served from China and territories (after UTF-8), with 5.5% of web servers serving a page declaring it.[3] Globally, GB2312 is declared on 0.1% of all web pages.[4] However, all major web browsers decode GB2312-marked documents as if they were marked with the superset GBK encoding, except for Safari and Edge on the label GB_2312.[5]
There is an analogous character set known as GB/T 12345Code of Chinese ideogram set for information interchange supplementary set, which supplements GB/T 2312 with traditional character forms by replacing simplified forms in their qūwèi code, and some extra 62 supplemental characters.[6][7] GB-encoded fonts often come in pairs, one with the GB/T 2312 (simplified) character set and the other with the GB/T 12345 (traditional) character set. There exists more GB supplementary encoding sets that supplements GB/T 2312, including GB/T 7589 Code of Chinese ideograms set forinformation interchange--The 2nd supplementary set and GB/T 7590 Code of Chinese ideograms set forinformation interchange--The 4th supplementary set which provides additional [Variant Chinese characters|variant characters] in the same qūwèi encoding format (later used in ISO-2022-CN), but has no relation with characters encoded in GB/T 2312.
Character range in rows
While GB/T 2312 covers over 99.99% contemporary Chinese text usage,[8] historical texts and many names remain out of scope. Old GB 2312 standard includes 6,763 Chinese characters (on two levels: the first is arranged by reading, the second by radical then number of strokes), along with symbols and punctuation, Japanese kana, the Greek and Cyrillic alphabets, Zhuyin, and a double-byte set of Pinyin letters with tone marks. In later version GB/T 2312-1980, there are 7,445 letters.
Characters in GB/T 2312 are arranged in a 94×94 grid (as in ISO 2022), and the two-byte code point of each character is expressed in the qūwèi (区位) form, which specifies a row (区; qū) and the position of the character within the row (cell; 位; wèi). (This structure is the same as used by other ISO-2022-based national CJK character set standards; compare kuten.) For example, the character "外" (meaning: foreign) is located in row 45 position 66,[9] thus its qūwèi code is 45-66.
The rows (numbered from 1 to 94) contain characters as follows:
56–87, the second level of Chinese characters, arranged according to radical and strokes. (3008 characters).
The rows 10–15 and 88–94 are unassigned.
For GB/T 2312-1980, it contains 682 signs and 6763 Chinese Characters.
Encodings of GB/T 2312
EUC-CN
EUC-CN is often used as the character encoding (i.e. for external storage) in programs that deal with GB/T 2312, thus maintaining compatibility with ASCII. Two bytes are used to represent every character not found in ASCII. The value of the first byte is from 0xA1–0xF7 (161–247), while the value of the second byte is from 0xA1–0xFE (161–254). Since all of these ranges are beyond ASCII, like UTF-8, it is possible to check if a byte is part of a multi-byte construct when using EUC-CN, but not if a byte is first or last.
Compared to UTF-8, GB/T 2312 (whether native or encoded in EUC-CN) is more storage efficient: while UTF-8 uses three bytes[a] per CJK ideograph, GB/T 2312 only uses two. However, GB/T 2312 does not cover as many ideographs as Unicode does.
To map the qūwèi code points to EUC bytes, add 160 (0xA0) to both the row number (or qū, 区) and cell/column number (ten or wèi, 位). The result of addition to the row number of the code point will form the high byte, and the result of addition to the cell number of the code point will form the low byte.
For example, to encode the character "外" at qūwèi cell 45-66, the high byte will use the row number 45: 45+160=205=0xCD, and the low byte will come from the cell number 66: 66+160=226=0xE2. So, the full encoding is <CD E2>.[10][11]
ISO-2022-CN
ISO-2022-CN is another encoding form of GB/T 2312, which is also the encoding specified in the official documentation. This encoding references the ISO-2022 standard, which also uses two bytes to encode characters not found in ASCII. However, instead of using the extended region of ASCII, ISO-2022 uses the same byte range as ASCII: the value of the first byte is from 0x21–0x77 (33–119), while the value of the second byte is from 0x21–0x7E (33–126). As the byte range overlaps ASCII significantly, special characters are required to indicate whether a character is in the ASCII range or is part of the two-byte sequence of extended region, namely the Shift Out and Shift In functions. This poses a risk for misencoding as improper handling of text can result in missing information.
To map the qūwèi code points to ISO-2022 bytes, add 32 (0x20) to both the row number (or qū, 区) and cell/column number (or wèi, 位). The result of addition to the row number of the code point will form the high byte, and the result of addition to the cell number of the code point will form the low byte similar to EUC encoding.
For example, to encode the character "外" at qūwèi cell 45-66, the high byte will use the row number 45: 45+32=77=0x4D, and the low byte will come from the cell number 66: 66+32=98=0x62. So, the full encoding is <4D 62>.[11]
HZ
HZ is another encoding of GB/T 2312 that is used mostly for Usenet postings; characters are represented with the same byte pairs as in ISO-2022-CN, but the byte sequences denoting the beginning and end of a range of GB 2312 text differ.
Code charts
In the tables below, where a pair of hexadecimal numbers is given for a prefix byte or a coding byte, the smaller (with the eighth bit unset or unavailable) is used when encoded over GL (0x21-0x7E), as in ISO-2022-CN or HZ-GB-2312, and the larger (with the eighth bit set) is used in the more typical case of it being encoded over GR (0xA1-0xFE), as in EUC-CN, GBK or GB 18030. Qūwèi numbers are given in decimal.
When GB/T 2312 is encoded over GR, both bytes have the eighth bit set (i.e. are greater than 0x7F). GBK and GB 18030 also make use of two-byte codes in which only the first byte has the eighth bit set for extension purposes: such codes are outside of the GB/T 2312 plane, and are not tabulated here.
Lead byte
This chart details the overall layout of the main plane of the GB/T 2312 character set by lead byte. For lead bytes used for characters other than hanzi, links are provided to charts on this page listing the characters encoded under that lead byte. For lead bytes used for hanzi, links are provided to the appropriate section of Wiktionary's hanzi index.
The following charts list the non-hanzi characters available in GB/T 2312, in GB/T 12345, and in double-byte region 1 of GB 18030 (which roughly corresponds to the non-hanzi region of GB/T 2312). Notes are made where these differ, and where GB 6345.1 and ISO-IR-165 differ from these. Cross-references are made to articles on other CJK national character sets for comparison.
Unicode mappings of the interpunct (Chinese: 间隔点; lit. 'separator dot') and em dash (Chinese: 破折号) in the subset of GBK and GB 18030 corresponding to GB/T 2312 (U+00B7·MIDDLE DOT and U+2014—EM DASH) differ from those which are listed in GB2312.TXT (U+30FB・KATAKANA MIDDLE DOT and U+2015―HORIZONTAL BAR), which is a data file which was previously provided by the Unicode Consortium,[13] although it has been designated as obsolete since August 2011[14] and is no longer hosted as of September 2016.
As of 2015, Microsoft .Net Framework follows GB 18030 mappings when mapping those two characters in data labelled gb2312, whereas ICU,[15] iconv-1.14,[16] php-5.6, ActivePerl-5.20, Java 1.7 and Python 3.4[17] follow GB2312.TXT in response to the gb2312 label. Ruby 2.2 is compatible with both implementations; it internally converts the conflictive characters to the GB 18030 subset. The W3C/WHATWG technical recommendation for use with HTML5 specifies a GBK encoding to be inferred for streams labelled gb2312, which in turn uses a GB18030 decoder.[18]
Other differing mappings have been defined and used by individual vendors,[13] including one from Apple.[19]
Character set 0x21/0xA1 (row 1: punctuation and symbols)
This row contains punctuation, mathematical operators, and other symbols. The following table shows the GB 18030 mappings[20] for these GB/T 2312 characters first, followed by any other documented mappings.
This row contains various types of list marker. Lowercase forms of the Roman numerals were not included in the original GB/T 2312[21] nor in GB/T 12345,[6] but are included in both Windows code page 936[22] and GB 18030.[20] A euro sign was also added by GB 18030.[20]
This row contains ISO 646-CN (GB/T 1988-80), a national counterpart to ASCII. Compare row 3 of KS X 1001, which does the same with South Korea's ISO 646 version, and row 3 of JIS X 0208 and of KPS 9566, which include only the alphanumeric subset, but in the same layout. The following chart lists ISO 646-CN.
When used in an encoding allowing combination with ASCII such as EUC-CN (and its superset GB 18030), these characters are usually implemented as fullwidth characters, hence mappings to the Halfwidth and Fullwidth Forms block are used as shown below. GB 6345.1 also handles this row as fullwidth, and adds the halfwidth forms (as above) as row 10.[1] Apple mostly maps this row to fullwidth code points as below, but uses non-fullwidth mappings for the overline and yuan sign as above.[19]
GB 2312 (prefixed with 0x23/0xA3); fullwidth mappings
This set contains Katakana for writing the Japanese language. However, the Japanese long vowel mark, which is used in katakana text and included in row 1 of JIS X 0208, is not included in GB/T 2312, although it is added in GBK and GB 18030 outside of the main GB/T 2312 plane,[24] at 0xA960.[20]
Character set 0x26/0xA6 (row 6: Greek and vertical extensions)
This row contains basic support for the modern Greek alphabet, without diacritics or the final sigma.
The highlighted characters are presentation forms of punctuation marks for vertical writing, and are not included in GB/T 2312 proper, but are included in this row by GB/T 12345,[1][6]Windows code page 936,[22] Mac OS Simplified Chinese,[19] and GB 18030.[20] They are seen as "standard extensions to GB 2312".[19] Conversely, ISO-IR-165 includes patterned semigraphic characters in this row (mostly without exact counterparts in Unicode), colliding with the code positions used for the vertical extensions.[25]
Compare with row 6 of JIS X 0208, which this row matches when the vertical forms are not included, and with row 6 of KPS 9566, which includes the same Greek letters in the same layout, but adds Roman numerals rather than vertical forms. Contrast row 5 of KS X 1001, which offsets the Greek letters to include the Roman numerals first.
Character set 0x28/0xA8 (row 8: zhuyin and non-ASCII pinyin)
This row contains bopomofo and pinyin characters, excluding ASCII letters (which are in row 3). The highlighted characters are those which are not in the base GB 2312 set but are added by GB 6345.1,[19] and also included in GB/T 12345,[1][6]Windows code page 936,[22] Mac OS Simplified Chinese[19] and GB 18030.[20] They are seen as "standard extensions to GB 2312".[19]
GB 6345.1 treats the pinyin in this row as fullwidth, and includes halfwidth counterparts as row 11;[1] GB 18030 does not do this.
GB 5007.1-85 24×24 BitmapFont Set of Chinese Characters for Information Exchange (Chinese: 信息交换用汉字 24x24 点阵字模集) is the earliest font template based on GB/T 2312 that features corrections and extensions including:
included 94 half-width glyphs in row 10 (half-width form of row 3, equivalent to GB 1988–80
included half-width form of 32 Hanyu Pinyin characters from row 8 in row 11.
GB/T 2312 did not have corrections, but these corrections are included in font templates that are based on GB/T 2312 including GB/T 12345; its supersets GBK and GB 18030 also included these corrections. GB/T 2312 is also used in ISO-IR-165.
Official font set
GB 5007.1—1985 24×24 Dot matrix font set of Chinese ideograms for information interchange
GB 5007.2—1985 24×24 Dot matrix font data set of Chinese ideograms for information interchange
GB 5199.1—1985 15×16 Dot matrix font set of Chinese ideograms for information interchange
GB 5199.2—1985 15×16 Dot matrix font data set of Chinese ideograms for information interchange
GB 6345.1—1986 32×32 Dot matrix font set of Chinese ideograms for information interchange
GB 6345.2—1986 32×32 Dot matrix font data set of Chinese ideograms for information interchange
GB/T 12034—1989 32×32 Dot matrix Fangsongti font set and data set of Chinese ideograms for information interchange
GB/T 12035—1989 32×32 Dot matrix Kaiti font set and data set of Chinese ideograms for information interchange
GB/T 12036—1989 32×32 Dot matrix Heiti font set and data set of Chinese ideograms for information interchange
GB/T 12037—1989 36×36 Dot matrix Songti font set and data set of Chinese ideograms for information interchange
GB/T 12038—1989 36×36 Dot matrix Fangsongti font set and data set of Chinese ideograms for information interchange
GB/T 12039—1989 36×36 Dot matrix Kaiti font set and data set of Chinese ideograms for information interchange
GB/T 12040—1989 36×36 Dot matrix Heiti font set and data set of Chinese ideograms for information interchange
GB/T 12041—1989 48×48 Dot matrix Songti font set and data set of Chinese ideograms for information interchange
GB/T 12042—1989 48×48 Dot matrix Fangsongti font set and data set of Chinese ideograms for information interchange
GB/T 12043—1989 48×48 Dot matrix Kaiti font set and data set of Chinese ideograms for information interchange
GB/T 12044—1989 48×48 Dot matrix Heiti font set and data set of Chinese ideograms for information interchange
GB/T 13443—1992 128×128 Dot matrix kaitifont set and data set of Chinese ideograms for information interchange
GB/T 13444—1992 128×128 Dot matrix Fangsongti font set and data set of Chinese ideograms for information interchange
GB/T 13445—1992 256×256 Dot matrix Kaiti font set and data set of Chinese ideograms for information interchange
GB/T 13446—1992 256×256 Dot matrix Fangsongti font set and data set of Chinese ideograms for information interchange
GB/T 13844—1992 Vector Danxian Songti font set and data set of Chinese ideogram for graphics information interchange
GB/T 13845—1992 Vector Songti font set and data set of Chinese ideogram for graphics information interchange
GB/T 13846—1992 Vector Fangsongti font set and data set of Chinese ideogram for graphics information interchange
GB/T 13847—1992 Vector Kaiti font set and data set of Chinese ideogram for graphics information interchange
GB/T 13848—1992 Vector Heiti font set and data set of Chinese ideogram for graphics information interchange
^Hannas, William C. (1997). Asia's Orthographic Dilemma. University of Hawai‘i Press. p. 264. ISBN9780824818920. the set provides for better than 99.99 percent of all usage. Nevertheless, the designers found it necessary to add 14,276 "special usage" characters to cover contingencies!
^Only for ideographs covered by GB/T 2312, all of which fall into Unicode BMP
^ abAs an ISO 2022 compatible 94n-character set, the plain space and delete character are available as single-byte codes at 0x20 and 0x7F (not 0xA0 and 0xFF) respectively.
^Used for
U+FF47 by most implementations based on GB 6345.1, including Apple's implementation and GB 18030 (which use 8-32 for
U+0261),[20] but for
U+0261 by ISO-IR-165.[23]
^ abcdefghijThese characters are from the Vertical Forms block. Some mappings in use were designed when the only vertical presentation forms which existed in Unicode were those in the CJK Compatibility Forms block. Specifically, they are mapped by Windows-936 and formerly GB 18030 to the Private Use Area, but with a defined glyph,[22][20] and by Apple to the regular fullwidth character with an appended private use character
U+F87E as a variation marker.[19] In the GB 18030-2022 update, these Private Use Area mappings has been eliminated and now mapped to their standard Unicode codepoints.[26]
^Mapped to the Private Use AreaU+E7C7 by the first (2000) edition of GB 18030, and also by Windows-936;[22] this was amended by the 2005 edition of GB 18030.[20]
^This composed character was added in Unicode 3.0. Prior to this, this character was mapped to its composition sequence (i.e. U+006E+0300) by Apple.[19] This change predates the stabilisation of Unicode normalisation forms, which was introduced in Unicode 3.1.[28] It is mapped to the Private Use AreaU+E7C8 by Windows-936.[22]
^Mapped to
U+0261 in GB 18030[20] and most other implementations based on GB 6345.1[19] (which use 3-71 for
U+FF47), but to
U+FF47 in ISO-IR-165.[23][25]
^ɑ (U+0251) ḿ (U+1E3F; Submitted in Unicode 3.0, thus Code page 936 did not include this character[29]) ń (U+0144) ň (U+0148) ǹ (U+01F9; Submitted in Unicode 3.0, thus Code page 936 did not include this character[29]) ɡ (U+0261)