What does a Unicode code point identify, and what does it not tell me?
Quick answer
A Unicode code point identifies a Unicode value, such as U+0061 for “a.” It does not, by itself, tell you how many visible characters you see or which bytes store the text. A displayed character can involve multiple code points, and the same code point can have different byte representations under different encodings. Keep the layers separate when inspecting text. [S1] [S2]
The question, the details, the next step.
A practical checklist
Write down the exact text you are inspecting, without substituting what you think it represents.
Check whether your tool reports visible text units, code points, or encoded bytes.
Record the encoding before interpreting stored bytes.
If a visible character seems to count as more than one unit, consider whether it uses a code-point sequence.
When comparing strings, allow for different code-point sequences that can represent the same abstract character.
A few more useful answers
Does a code point tell me how many bytes a character uses?
No. A code point identifies a Unicode value, while an encoding determines its byte representation. The same value can use different encoding units in different encodings. [S1]
Is a grapheme cluster the same as a code point?
No. A grapheme cluster is an approximation for a user-perceived text unit; a perceived character may involve a sequence of code points. [S2]
Can two different code-point sequences represent the same character?
Yes. The W3C character model notes that multiple Unicode code-point sequences can represent the same abstract character. [S2]
Sources
References used for this guide.
- [S1] Microsoft Learn: Introduction to character encoding in .NET learn.microsoft.com · Checked
- [S2] W3C Character Model for the World Wide Web: String Matching w3.org · Checked
