Không gian mã
Toàn bộ phạm vi các điểm mã Unicode có thể có: U+0000 đến U+10FFFF (tổng cộng 1.114.112), được chia thành 17 mặt phẳng, mỗi mặt phẳng có 65.536 điểm mã.
What is the Unicode Code Space?
The code space is the complete range of integer values available for Unicode code points: U+0000 through U+10FFFF, totaling exactly 1,114,112 positions. Think of it as the full address space of the Unicode standard — every character, symbol, and abstract entity that could ever be assigned a Unicode code point must fit within this range.
The code space is not fully occupied. As of Unicode 16.0, approximately 154,998 of these positions are assigned to characters. The remaining ~959,000 positions are either unassigned (available for future characters), reserved, or permanently designated as noncharacters or private use.
The Numbers
U+0000 → U+10FFFF
0 → 1,114,111
Total code points: 1,114,112
= 17 planes × 65,536 points per plane
= 17 × 0x10000
= 0x110000 (hex)
= 2^21 - 2^16 = ? (not a round power of 2 — see below)
The value 1,114,112 is not a round power of two. It equals 17 × 65,536, which results from the deliberate choice to have 17 planes of 65,536 each. The upper limit of U+10FFFF was set to match the maximum value expressible by UTF-16 surrogate pairs, making UTF-16 the natural encoding boundary.
Why U+10FFFF as the Upper Limit?
UTF-16 uses surrogate pairs to encode supplementary characters. Each surrogate half occupies a 10-bit value, so a pair provides 20 bits of additional addressing: 2^20 = 1,048,576 supplementary code points. Adding the 65,536 BMP positions yields exactly 1,114,112 — the size of the code space. The U+10FFFF upper limit was thus engineered to keep UTF-16 and the code space in perfect alignment.
Code Space Breakdown
| Category | Count (approx.) | Notes |
|---|---|---|
| Assigned characters | 154,998 | Unicode 16.0 |
| Private Use Area | 137,468 | U+E000–U+F8FF, U+F0000–U+FFFFF, U+100000–U+10FFFF |
| Surrogates (reserved) | 2,048 | U+D800–U+DFFF — never characters |
| Noncharacters | 66 | 32 at end of each plane + 34 in Arabic Presentation Forms-A |
| Unassigned | ~819,000 | Available for future Unicode versions |
Code Space vs Character Repertoire
The code space defines positions; the character repertoire is the subset of those positions that are currently assigned. Unicode's stability policies ensure that once a character is assigned to a position, that assignment is permanent — no code point is ever recycled or reassigned to a different character.
# Python: check if a code point is within the Unicode code space
def is_valid_code_point(cp: int) -> bool:
return 0x0000 <= cp <= 0x10FFFF
# Check for surrogate range (not real characters)
def is_surrogate(cp: int) -> bool:
return 0xD800 <= cp <= 0xDFFF
# Check for noncharacter
def is_noncharacter(cp: int) -> bool:
last_two = cp & 0xFFFF
return last_two in (0xFFFE, 0xFFFF) or 0xFDD0 <= cp <= 0xFDEF
Historical Context
The original Unicode proposal (1988) envisioned a 16-bit code space of 65,536 characters.
Engineers believed this would be sufficient for all world languages. By Unicode 2.0 (1996) it was
clear the CJK ideograph extensions alone would exceed this limit. The standard was extended to
21 bits (the current code space), but the legacy 16-bit assumption is why surrogate pairs exist
in UTF-16 and why JavaScript's String.length counts UTF-16 code units rather than Unicode
code points.
Quick Facts
| Property | Value |
|---|---|
| Minimum | U+0000 |
| Maximum | U+10FFFF |
| Total positions | 1,114,112 |
| Assigned (v16.0) | ~154,998 (13.9%) |
| Private use | 137,468 |
| Surrogates (permanently reserved) | 2,048 |
| Noncharacters | 66 |
| Bit width required | 21 bits |
| UTF-16 coverage | Exactly matches code space upper bound |
Thuật ngữ liên quan
Thêm trong Tiêu chuẩn Unicode
Mặt phẳng 0 (U+0000–U+FFFF), chứa các ký tự được sử dụng phổ …
Đảm bảo rằng một khi ký tự được gán, điểm mã và …
Trung Quốc, Nhật Bản và Hàn Quốc — thuật ngữ tập thể …
Bất kỳ điểm mã nào ngoại trừ các điểm mã surrogate (U+D800–U+DFFF). …
The process of mapping Chinese, Japanese, and Korean ideographs that share a …
The individual consonant and vowel components (jamo) of the Korean Hangul writing …
Tổ chức phi lợi nhuận phát triển và duy trì Tiêu chuẩn …
Tiêu chuẩn quốc tế (ISO/IEC 10646) được đồng bộ hóa với Unicode, …
Các điểm mã U+D800–U+DFFF được dành riêng cho các cặp thay thế …
Đơn vị thông tin dùng để tổ chức, điều khiển hoặc biểu …