ASCII(アスキー)
128個の文字を数値(0〜127)に割り当てる7ビットの文字コード標準。
ASCIIのレイアウトはビット演算に最適化されています。大文字と小文字の違いは6番目のビットだけであり、単純なビット演算で変換可能でした。現在でもUnicodeの最初の128文字はASCIIと完全に一致しています。
graph LR
Center["ASCII(アスキー)"]:::main
Rel_unicode["unicode"]:::related -.-> Center
click Rel_unicode "/terms/unicode"
Rel_binary["binary"]:::related -.-> Center
click Rel_binary "/terms/binary"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 5歳でもわかるように説明
コンピュータは数字しか理解できません。ASCIIは「65を見たら大文字のAを描き、32を見たら空白を作れ」という世界共通の暗号のようなものです。
🤓 Expert Deep Dive
真のASCIIは厳密に7ビットです。制御コード(0x00-0x1F)はテレタイプ用に設計されました(例:改行のCRとLF)。8ビット目を使用した「拡張ASCII」は互換性の問題を引き起こしましたが、UTF-8は7ビットASCIIとの完全な後方互換性を維持するように見事に設計されました。
❓ よくある質問
Why is ASCII only 7 bits instead of 8 bits?
When ASCII was developed in the 1960s, a 7-bit code was sufficient to represent the English alphabet, numbers, and punctuation. The 8th bit in a byte was often reserved as a parity bit to check for errors during data transmission over unreliable networks.
What is the difference between ASCII and Unicode?
ASCII is limited to 128 characters and primarily supports English. Unicode is a massive standard designed to support over 149,000 characters across almost every language in the world, plus emojis. However, the first 128 characters of Unicode are identical to ASCII.
What are Extended ASCII codes?
Since computers use 8-bit bytes, the 7-bit ASCII standard left the 8th bit unused (values 128-255). Different companies (like IBM, Apple, and Microsoft) used these extra 128 slots for foreign letters and drawing symbols, creating incompatible 'Extended ASCII' code pages.