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:
| Era | Encoding | Characters |
|---|---|---|
| 1963 | ASCII | 128 (English only) |
| 1987 | ISO 8859-1 (Latin-1) | 256 (Western European) |
| 1990s | Windows code pages | 256 per page (regional) |
| 1978+ | CJK double-byte | 6,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):
| Encoding | Region | Upper half contains | |
|---|---|---|---|
| ISO 8859-1 / Latin-1 | Western Europe | àáâãäå, ñ, ü, ß, etc. | |
| Windows-1252 | Western Europe | Same + €, | , —, etc. |
| ISO 8859-2 | Central Europe | ą, ć, č, ě, ł, ő, ž, etc. | |
| Windows-1251 | Cyrillic | А-Я, а-я, etc. | |
| KOI8-U | Ukrainian | Cyrillic (different order) | |
| ISO 8859-7 | Greek | Α-Ω, α-ω, 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:
| Encoding | Language | Standard |
|---|---|---|
| Shift_JIS / CP932 | Japanese | JIS X 0208 / Windows-31J |
| EUC-JP | Japanese | JIS X 0208 (Unix) |
| ISO-2022-JP | Japanese | JIS X 0208 (Email) |
| Big5 | Chinese (Traditional) | Taiwan standard |
| GBK / GB18030 | Chinese (Simplified) | China standard |
| EUC-KR (CP949) | Korean | KS 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 以前は、各言語に固有のエンコーディングが必要でした。その結果、同じ問題を異なる方法で解決する規格が乱立しました:
| 年代 | エンコーディング | 文字数 |
|---|---|---|
| 1963 | ASCII | 128(英語のみ) |
| 1987 | ISO 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-1 を windows-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 等)でのエンコード可否を確認。