Code Point
A code point is the numeric value the Unicode standard assigns to each character (U+0000 to U+10FFFF), the character's position number in the codespace.
Purpose
It gives every character a unique numeric identifier so characters can be enumerated, looked up, and referenced independently of any encoding form.
Mechanism
Code points are written as U+ followed by 4-6 hexadecimal digits. The codespace is divided into 17 planes of 65,536 code points each; Plane 0 (the BMP) is the most used. Not every code point is assigned to a character (some are reserved or in the surrogate range).
Use cases
- Unicode character lookup and documentation
- Regular expression \uXXXX escapes
- Character classification and property tests
- NFC/NFD normalization
Examples
- Input
AOutputU+0041The code point of uppercase A
Common errors
- Confusing code points with UTF-8 bytes (U+4E2D is not 0x4E 0x2D)
- A code point must pass through an encoding form to become bytes
Related terms
Unicode
Unicode is the international character encoding standard that assigns a unique code point (U+0000 through U+10FFFF) to every character of nearly all the world's writing systems, with a codespace of 1,114,112 code points. GLOSSARY
UTF-8
UTF-8 is Unicode's variable-length encoding form, using 1 to 4 bytes per code point; it is fully backward compatible with ASCII and is the de facto standard for the web and modern systems. GLOSSARY
Surrogate Pair
A surrogate pair is the UTF-16 mechanism that represents one supplementary-plane code point (U+10000 through U+10FFFF) using two 16-bit code units. GLOSSARY
Charset
A character set (charset) is the mapping table from characters to code points; together with an encoding form (such as UTF-8) it determines how text becomes a byte stream. GLOSSARY