Binary → text with a corrupted byte — binary and text
edge casewhat to do with input that cannot decode
Answer
1 invalid byte(s) flagged, not silently replaced
Why this example is worth doing
A bit string that is not valid UTF-8, which the tool reports as invalid at a specific byte offset rather than substituting a replacement character and pretending it worked. The page explains what makes a sequence invalid — a continuation byte without a leader, or a leader promising more bytes than are present — and this is deliberately the one example on the page with no clean answer, because the diagnostic is the answer.
Try your own input in the Binary ⇄ text / ASCII. Convert text to binary and back, byte by byte, with the full UTF-8 breakdown.
How the answer is reached
Decode 2 bytes as UTF-8
| byte | binary | hex | decimal |
|---|---|---|---|
| 0 | 11000011 | C3 | 195 |
| 1 | 00101001 | 29 | 41 |
| code point | character |
|---|---|
| U+FFFD | � |
| U+0029 | ) |
text�)
1 invalid sequence replaced with U+FFFD, at byte offset 0. In fatal mode this input would be rejected instead.
Source: RFC 3629; WHATWG Encoding Standard