is a key official character set of the People's Republic of China, used for Simplified Chinese characters. GB2312 is the registered internet name for EUC-CN, which is its usual encoded form. GB refers to the Guobiao standards (国家标准), whereas the T suffix () denotes a non-mandatory standard.

was originally a mandatory national standard designated . 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 . has been superseded by GBK and GB 18030, which include additional characters, but remains in widespread use as a subset of those encodings.

, GB2312 is the second-most popular encoding served from China and territories (after UTF-8), with <!--3.6% or showing arguably correct 100-96.5% = --> 3.5% of web servers serving a page declaring it. Globally, GB2312 is declared on less than 0.05% of all web pages. 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 <code>GB_2312</code> (they do however decode <code>GB_2312-80</code> and <code>GB2312</code> as the superset).

There is an analogous character set known as GB/T&nbsp;12345 Code of Chinese ideogram set for information interchange supplementary set, which supplements GB/T&nbsp;2312 with traditional character forms by replacing simplified forms in their qūwèi code, and some extra 62 supplemental characters. GB-encoded fonts often come in pairs, one with the GB/T&nbsp;2312 (simplified) character set and the other with the GB/T&nbsp;12345 (traditional) character set. There exists more GB supplementary encoding sets that supplements GB/T&nbsp;2312, including GB/T&nbsp;7589 Code of Chinese ideograms set forinformation interchange--The 2nd supplementary set and GB/T&nbsp;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&nbsp;2312.

<!-- translated from Chinese Wikipedia -->

Character range in rows

While GB/T&nbsp;2312 covers over 99.99% contemporary Chinese text usage, historical texts and many names remain out of scope. Old 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&nbsp;2312-1980, there are 7,445 letters.

Characters in GB/T&nbsp;2312 are arranged in a 94×94 grid (as in ISO&nbsp;2022), and the two-byte code point of each character is expressed in the qūwèi () form, which specifies a row () and the position of the character within the row (cell; ). (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, thus its qūwèi code is 45-66.

The rows (numbered from 1 to 94) contain characters as follows:

  • 01–09, comprising punctuation and other special characters; also Hiragana, Katakana, Greek, Cyrillic, Pinyin, Bopomofo
  • 16–55, the first level of Chinese characters, arranged according to Pinyin. (3755 characters).
  • 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&nbsp;2312-1980, it contains 682 signs and 6763 Chinese Characters.

Encodings of GB/T&nbsp;2312

EUC-CN

EUC-CN is often used as the character encoding (i.e. for external storage) in programs that deal with GB/T&nbsp;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 <code>0xA1–0xF7</code> (161–247), while the value of the second byte is from <code>0xA1–0xFE</code> (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&nbsp;2312 (whether native or encoded in EUC-CN) is more storage efficient: while UTF-8 uses three bytes per CJK ideograph, GB/T&nbsp;2312 only uses two. However, GB/T&nbsp;2312 does not cover as many ideographs as Unicode does.

To map the qūwèi code points to EUC bytes, add 160 (<code>0xA0</code>) 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=<code>0xCD</code>, and the low byte will come from the cell number 66: 66+160=226=<code>0xE2</code>. So, the full encoding is <code><CD E2></code>.

ISO-2022-CN

ISO-2022-CN is another encoding form of GB/T&nbsp;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 <code>0x21–0x77</code> (33–119), while the value of the second byte is from <code>0x21–0x7E</code> (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 (<code>0x20</code>) 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=<code>0x4D</code>, and the low byte will come from the cell number 66: 66+32=98=<code>0x62</code>. So, the full encoding is <code><4D 62></code>.

|-

|A1A4

|

|

|

|-

|A1AA

|

|

|

|}

Unicode mappings of the interpunct () and em dash () in the subset of GBK and GB 18030 corresponding to GB/T 2312 ( and ) differ from those which are listed in GB2312.TXT ( and ), which is a data file which was previously provided by the Unicode Consortium, although it has been designated as obsolete since August 2011 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 , whereas ICU, iconv-1.14, php-5.6, ActivePerl-5.20, Java 1.7 and Python 3.4 follow GB2312.TXT in response to the 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 <code>gb2312</code>, which in turn uses a GB18030 decoder.

Other differing mappings have been defined and used by individual vendors, nor in GB/T 12345, and GB 18030. but for U+0261 by ISO-IR-165.

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|}

<span class="anchor" id="0x24"></span><span class="anchor" id="0xA4"></span><span class="anchor" id="row 4"></span>Character set 0x24/0xA4 (row 4: Hiragana)

This set contains Hiragana for writing the Japanese language.

Compare with row 4 of JIS X 0208, which this row matches, and with row 10 of KS X 1001 and of KPS 9566, which use the same layout, but in a different row.

{|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|}

<span class="anchor" id="0x25"></span><span class="anchor" id="0xA5"></span><span class="anchor" id="row 5"></span>Character set 0x25/0xA5 (row 5: Katakana)

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, at 0xA960.<!-- 0x96C0 listed by Lunde is 柪 --> and GB 18030.|style=background:#FFD

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|}

<span class="anchor" id="0x27"></span><span class="anchor" id="0xA7"></span><span class="anchor" id="row 7"></span>Character set 0x27/0xA7 (row 7: Cyrillic)

This set includes both cases of 33 letters from the Cyrillic script, sufficient to write the modern Russian alphabet and Bulgarian alphabet, although other forms of Cyrillic require additional letters.

Compare with row 7 of JIS X 0208, which this row matches, and with row 12 of KS X 1001 and row 5 of KPS 9566, which use the same layout but in different rows.

{|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|}

<span class="anchor" id="0x28"></span><span class="anchor" id="0xA8"></span><span class="anchor" id="row 8"></span>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, It is mapped to the Private Use Area by Windows-936.|style=background:#FFD

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|}

<span class="anchor" id="0x29"></span><span class="anchor" id="0xA9"></span><span class="anchor" id="row 9"></span>Character set 0x29/0xA9 (row 9: box drawing)

{|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|-

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|}

Hanzi rows

<!-- Including all of them here would easily swamp the article and make it hard to display/navigate. Including only a couple would be at best not particularly useful, and at worst misleading. As for including it in a separate article on Wikipedia, that was already attempted and deleted: https://en.wikipedia.org/wiki/Special:Log?type=delete&page=GB2312+Blocks -->

Corrections

GB&nbsp;5007.1-85 24×24 Bitmap Font Set of Chinese Characters for Information Exchange () is the earliest font template based on GB/T&nbsp;2312 that features corrections and extensions including:

  • changing the glyph shape of Latin alphabet "g"
  • adding 6 Hanyu Pinyin characters: ɑ, ḿ, ń, ň, ǹ, ɡ