Interactive UTF-8 Decoder Demo
This decoder is part of my series on decoding UTF-8
To help illustrate my explanation, I've written an interactive decoder below.
First, enter in a series of bytes in hexadecimal. Then, press the "Decode"
button. The resulting output (or error) will be displayed in the output box.
For example, entering "F2 80 9F A2" will result in the byte sequence <0xF2 0x80 0x9F 0xA2>. When decoded, it should result in U+807E2.
Output:Press "Decode" to view output
Some Example Inputs and Outputs
41→U+41ED 9F 80→U+D7C0F4 80 80 8F→U+10000FED BF 80→UTF8 Decode Error: Decoded surrogate near byte 4C1 81→UTF8 Decode Error: Overlong near byte 341 42 80→UTF8 Decode Error: Invalid code unit at byte 4