📜

Legacy Encoding Survival Guide: From ASCII to GB18030レガシーエンコーディング・サバイバルガイド: ASCIIからGB18030まで

A practical overview of 20+ character encodings across languages, how they relate, and how to identify them.20以上のエンコーディングの実践的概要。エンコーディングの関係性と識別方法。

The Encoding Family Tree

Before Unicode, every language needed its own encoding. The result was a tangled tree of standards, each solving the same problem differently:

EraEncodingCharacters
1963ASCII128 (English only)
1987ISO 8859-1 (Latin-1)256 (Western European)
1990sWindows code pages256 per page (regional)
1978+CJK double-byte6,000-20,000 (East Asian)
1991+Unicode (UTF-8/16)150,000+ (all languages)

This tool shows encoding bytes for 20+ legacy encodings simultaneously, letting you compare how the same character is represented across different systems.

Single-Byte Encodings

Single-byte encodings map each byte (0x00-0xFF) to one character. They share ASCII in the lower half (0x00-0x7F) but differ in the upper half (0x80-0xFF):

EncodingRegionUpper half contains
ISO 8859-1 / Latin-1Western Europeàáâãäå, ñ, ü, ß, etc.
Windows-1252Western EuropeSame + €, , —, etc.
ISO 8859-2Central Europeą, ć, č, ě, ł, ő, ž, etc.
Windows-1251CyrillicА-Я, а-я, etc.
KOI8-UUkrainianCyrillic (different order)
ISO 8859-7GreekΑ-Ω, α-ω, etc.

WHATWG treats iso-8859-1 as windows-1252. Bytes 0x80-0x9F that are C1 controls in ISO 8859-1 become typographic characters (€, ", —) in Windows-1252.

East Asian Double-Byte Encodings

CJK languages need thousands of characters, requiring multi-byte encodings:

EncodingLanguageStandard
Shift_JIS / CP932JapaneseJIS X 0208 / Windows-31J
EUC-JPJapaneseJIS X 0208 (Unix)
ISO-2022-JPJapaneseJIS X 0208 (Email)
Big5Chinese (Traditional)Taiwan standard
GBK / GB18030Chinese (Simplified)China standard
EUC-KR (CP949)KoreanKS X 1001 / UHC

The same CJK character gets completely different byte sequences in each encoding. This tool shows them all side by side.

Auto-Detection: How the Tool Picks Encodings

This tool automatically detects which encoding groups are relevant for each character using two methods:

For CJK characters: The Unihan IRG Source database (88,000+ characters) identifies which national standards include each character. This is more accurate than simple encoding checks.

For other scripts: Encodability checks against the broadest encoding in each group (e.g., Windows-1252 for Western, Windows-1251 for Cyrillic).

エンコーディングの系譜

Unicode 以前は、各言語に固有のエンコーディングが必要でした。その結果、同じ問題を異なる方法で解決する規格が乱立しました:

年代エンコーディング文字数
1963ASCII128(英語のみ)
1987ISO 8859-1 (Latin-1)256(西欧)
1990年代Windows コードページ各256(地域別)
1978年〜CJK ダブルバイト6,000〜20,000(東アジア)
1991年〜Unicode (UTF-8/16)15万以上(全言語)

このツールは20以上のレガシーエンコーディングのバイト列を同時に表示し、同じ文字がシステムごとにどう表現されるか比較できます。

シングルバイト・エンコーディング

シングルバイト・エンコーディングは各バイト (0x00-0xFF) を1文字にマップします。下半分 (0x00-0x7F) は ASCII 共通ですが、上半分 (0x80-0xFF) は異なります:

エンコーディング地域上半分の内容
ISO 8859-1 / Latin-1西欧àáâãäå, ñ, ü, ß 等
Windows-1252西欧同上 + €, , — 等
ISO 8859-2中央ヨーロッパą, ć, č, ě, ł, ő, ž 等
Windows-1251キリル文字А-Я, а-я 等
KOI8-Uウクライナキリル文字(異なる配置)

WHATWG は iso-8859-1windows-1252 として扱います。ISO 8859-1 で C1 制御文字の 0x80-0x9F が、Windows-1252 ではタイポグラフィ文字(€, ", —)になります。

東アジアのダブルバイト・エンコーディング

CJK 言語は数千の文字が必要なため、マルチバイト・エンコーディングを使用します:

エンコーディング言語規格
Shift_JIS / CP932日本語JIS X 0208 / Windows-31J
EUC-JP日本語JIS X 0208 (Unix系)
ISO-2022-JP日本語JIS X 0208 (メール)
Big5中国語(繁体字)台湾規格
GBK / GB18030中国語(簡体字)中国規格
EUC-KR (CP949)韓国語KS X 1001 / UHC

同じ CJK 文字でもエンコーディングごとに全く異なるバイト列になります。このツールで並べて比較できます。

自動検出の仕組み

このツールは2つの方法で各文字に関連するエンコーディングを自動検出します:

CJK 文字: Unihan IRG ソースデータベース(88,000字以上)で各国規格への収録状況を確認。単純なエンコード可否チェックより正確です。

その他のスクリプト: 各グループの最も広いエンコーディング(西欧は Windows-1252、キリルは Windows-1251 等)でのエンコード可否を確認。