Back to Character Encoding

GB2312 GB2312 (Simplified Chinese, 1980 standard) Legacy & Platform-Specific

The original Simplified Chinese national encoding standard, later expanded by GBK and eventually GB18030 — largely superseded but still the historical foundation.

What it is

GB2312, published in 1980, was the original Simplified Chinese national character encoding standard — the foundation that GBK later expanded, which GB18030 subsequently extended to full Unicode coverage. GB2312 itself covers a comparatively limited set of the most common Simplified Chinese characters (roughly 6,000+ commonly used characters), sufficient for most everyday text at the time but not comprehensive by modern standards.

Byte structure

Byte pattern Length Content
0x00–0x7F 1 byte ASCII-compatible range
Two high-bit-set bytes 2 bytes Common Simplified Chinese characters, covering the most frequently used ~6,000+ characters

Why your text is garbled (symptom → cause)

Symptom Likely cause
Chinese text shows as unrelated symbols GB2312 being read as UTF-8, Big5, or another encoding, or vice versa
Rare/uncommon Chinese characters fail to display even with correct decoding GB2312's limited character coverage genuinely doesn't include less common characters — this isn't a decoding error, it's a real coverage gap that GBK/GB18030 later addressed
Old Chinese-language database exports garbled after modern import Legacy GB2312 data needing explicit conversion to UTF-8

Compatibility & gotchas

  • Limited character coverage is a genuine constraint, not just a historical curiosity — GB2312 simply cannot represent characters outside its original ~6,000+ character set, regardless of correct decoding. Text requiring broader coverage needs GBK or GB18030 instead.
  • The direct predecessor to GBK and GB18030 — understanding GB2312 helps explain why those later standards exist and what specific gaps they were built to close.
  • Distinct from Traditional Chinese encodings like Big5 — GB2312 and its successors cover Simplified Chinese characters, used primarily in mainland China, while Big5 covers Traditional Chinese characters used in Taiwan, Hong Kong, and Macau.

Fixing it

  • Command-line conversion: iconv -f GB2312 -t UTF-8 input.txt -o output.txt
  • If some characters fail to decode/display: the source data may actually be GBK or GB18030 (both are backward-compatible supersets) rather than strict GB2312 — try those instead.

Comparison

Encoding Key difference from GB2312
GBK Direct successor, significantly expanded character coverage while remaining backward-compatible
GB18030 Further extension covering all of Unicode, and — since 2001 — a Chinese regulatory requirement
Big5 Covers Traditional rather than Simplified Chinese characters, used in a different region

FAQ

Is GB2312 still used today?

Rarely as a primary encoding for new content — GBK and especially GB18030 (which is a legal requirement for software sold in China) have effectively superseded it, though GB2312-encoded legacy data still exists in older systems.

Why does some Chinese text fail to decode even correctly under GB2312?

GB2312's original character set only covers roughly 6,000+ of the most common Simplified Chinese characters — genuinely rare or specialized characters simply aren't representable in GB2312 at all, regardless of decoding correctness. GBK and GB18030 were developed specifically to close this gap.

Fun fact

GB2312's original ~6,000-character coverage was based on frequency-of-use analysis from the late 1970s — a reminder that "sufficient" character coverage is a moving target shaped by the text corpus available when a standard is designed, which is part of why later revisions (GBK, then GB18030) kept finding new gaps to close as usage patterns and available reference material expanded.