Visual RFC.
ALL RFCs / RFC 2781
Read the RFC ↗
RFC 2781 / UTF-16 REPRESENTATION

Encode one scalar into one or two code units

01

A Unicode scalar is a numeric code point outside the reserved surrogate range. UTF-16 represents it with one or two 16-bit code units; bytes come later.

RFC 2781 · § 2.1EXAMPLE
4 / 4
Encode one scalar into one or two code unitsAdd surrogate bases to emit highD808thenlowDF45; two units.Scalar value → UTF-16 code unitsD808DF45high surrogatelow surrogateD808 then DF45 encodes U+12345Two 16-bit units; four serialized bytesHexadecimal worked values; no current character-name claim for U+12345
04
Emit high then low surrogate

D800 + 008 gives D808; DC00 + 345 gives DF45. The ordered pair D808 DF45 encodes U+12345 and will occupy four bytes when serialized.

Source for this drawing: RFC 2781 · Read RFC source: § 2.1 ↗

Protocol participantThreat or exceptionProtocol controlSimplified drawings · precise section references
New to this? Start hereA quick picture + helpful background

A message needs an address.

Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.

Helpful first, if these ideas are unfamiliar

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.

KEY POINT

Values below U+10000 outside D800–DFFF use one 16-bit unit. Supplementary values through U+10FFFF use a high surrogate followed by a low surrogate.

  • Values below U+10000 outside D800–DFFF use one 16-bit unit. Supplementary values through U+10FFFF use a high surrogate followed by a low surrogate.
  • For a supplementary value, subtract 0x10000, split the remaining 20 bits into two groups of ten, then add bases D800 and DC00.
  • Surrogates are reserved code-unit values, not independent characters. Representable numbers do not guarantee assigned, displayable or safe text.
DETAILS

The BMP is the Basic Multilingual Plane. Numeric values are hexadecimal. RFC2781’s Unicode3.0-era observation about then-assigned characters is historical, not a claim that today’s assigned characters all fit the BMP. The RFC’s U+12345 glyph story is not asserted as a modern character identity.

Read the RFC section ↗

All chapters in RFC 2781

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 ↗