Encode one scalar into one or two code units
01A 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.
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 ↗
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.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
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.
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 ↗