How do the pieces tell the reader where they belong?
02Some bits act like labels. The remaining bits carry the character number.
We are packing a number, not cutting up a picture.
The shared list calls this a code point.
What happens if you change this?
Make one change, then watch again. Restart restores the original example.
The resulting bytes decode to the original scalar value.
Key idea: The labels describe the pieces; the remaining bits carry the character number.
Terms
- UTF-8
- A rule for turning Unicode character numbers into ordered bytes, and back.
- Code point
- A character number in Unicode. A scalar value excludes reserved surrogate numbers.
- Byte / bit
- A byte is eight bits. A bit has one of two values: zero or one.
- Leading / continuation byte
- The first piece tells the reader how many bytes belong together. Following pieces start with the bits 10.
- Normalization
- A specified way to transform Unicode text before comparison. It does not turn every lookalike into the same letter.
- BOM
- A contextual initial encoding signature. UTF-8 never uses it to switch byte order.
Rules & examples
The labels describe the pieces; the remaining bits carry the character number.
- The euro sign uses the 1110xxxx 10xxxxxx 10xxxxxx pattern.
- Only the x positions carry code-point bits.
- Use the shortest permitted encoding for the value.
Examples are illustrative. Consult the linked RFC and its errata for implementation details.
RFC 3629 §§3–4. Payload groups 0010 / 000010 / 101100. Original bytes E2 82 AC; selected bytes E2 82 AC. This uses the shortest permitted encoding and the restricted second-byte ranges. It does not encode UTF-16 surrogate halves separately.
Sources
New to this? Start hereA quick picture + helpful background
First, agree how to read the message.
An encoding tells a reader how to interpret bytes. A format tells it how values fit together. Correctly reading a value does not make that value trustworthy.
Start with this guide; no earlier guide is needed for the overview.
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.