Visual RFC.
ALL RFCs / RFC 3629
Read the RFC ↗
RFC 3629 / MECHANISM GUIDE

What if a piece is missing or has the wrong label?

03

A careful reader checks the whole item before treating its bytes as a character.

RFC 3629 · § 4EXAMPLE
1 / 4 · Receive some small pieces

Do not guess a character from only the bits you hoped to see.

Incoming pieces

Byte 1
11100010
Value 226
Byte 2
10000010
Value 130

Each piece is eight bits: 1 = on, 0 = off. Read the pieces in this order.

What happens if you change this?

Make one change, then watch again. Restart restores the original example.

3 / 3
03
Use valid encoding

Slash is represented by the single byte 2F.

What if a piece is missing or has the wrong label?A careful reader checks the whole item before treating its bytes as a character.What if a piece is missing or has the wrong label?2FValid slash: one byteUse the shortest permitted form

Key idea: A partial valid beginning can wait. A forbidden encoding must not be accepted as valid text.

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.

Look up a term in the glossary ↗

Rules & examples
  • Do not decode invalid sequences or surrogate values as valid characters.
  • UTF-8 does not encode values above U+10FFFF.
  • Overlong sequences can create security failures when filters and decoders disagree.

Examples are illustrative. Consult the linked RFC and its errata for implementation details.

RFC 3629 §§3–4,10. Bytes E2 82. Keep the partial item and wait for more bytes. Streaming wait is a teaching reader state, not permission to accept truncated final input. Overlong forms, surrogates, values above U+10FFFF and five/six-byte forms are not UTF-8. Recovery/replacement policy belongs to the application.

Sources
Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
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.

All chapters in RFC 3629

Drawing view

Scroll the drawing to see every part. Playback controls stay above it.

RFC 9700 / CHAPTERS

Chapters

For full details, tables, algorithms, and exceptions, read the original RFC.

RFC status and corrections ↗