SESK: Stuff Everyone Should Know · sesk.info/tech-utf8-ascii-compatible
A plain ASCII text file is read as UTF-8. What happens?
It reads perfectly, because ASCII bytes are already valid UTF-8.
- It reads perfectly ✔
- Every character turns to gibberish
- It must be converted first
Why: UTF-8 keeps the exact one-byte values of all 128 ASCII characters. Therefore, every valid ASCII byte sequence is also valid UTF-8 and needs no conversion.
Huh, didn't know that: In UTF-8, bytes of multibyte characters all have the top bit set, so they can never be mistaken for ASCII characters like a slash.
Why did ASCII feel at home in UTF-8? Because nothing about it had to change.
Like this card?
References
Answer: It reads perfectly. UTF-8 keeps the exact one-byte values of all 128 ASCII characters. Therefore, every valid ASCII byte sequence is also valid UTF-8 and needs no conversion.
- RFC 3629: UTF-8, a transformation format of ISO 10646 www.rfc-editor.org/rfc/rfc3629.txt
US-ASCII characters are encoded in one octet having the normal US-ASCII value
Checked 2026-10-10.
Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.
More stuff everyone should know
That's stuff everyone should know.