Unicode microscope · four countable layers
“Character” is usually four different measurements.
What a person sees, what JavaScript counts, what Unicode assigns, and what UTF-8 stores can all disagree. The inspector keeps each layer visible before normalization, escaping, or sorting changes the evidence.
Graphemes
user-perceived cluster
Code points
Unicode scalars
UTF-16 units
JavaScript length
UTF-8 bytes
encoded storage
Cluster anatomy microscope
U+1F468MANsurrogate pairU+1F3FDSKIN TONEmodifierU+200DZWJjoin signalU+1F4BBLAPTOPsurrogate pairCode-point ledger
Normalization prism
Same appearance can carry different bytes.
é
U+00E9
2 bytes
e + ◌́
U+0065 U+0301
3 bytes
compatibility fold
may erase width/ligature distinctions
decompose + fold
most transformative
Invisible-character radar
U+FEFFfile/text boundary
U+200D / U+200Cshaping and emoji
U+202A…U+2069visual order
U+00A0 / U+202Fnon-breaking layout
U+FE0Fpresentation choice
Escape customs
U+1F680 brace escapescalar syntax
\uD83D\uDE80UTF-16 surrogate pair
🚀numeric character reference
U+1F680 brace escapeUnicode scalar syntax
Sorting boundary
Code-point order is not human collation.
Locale, sensitivity, numeric behavior, normalization form, and runtime Unicode data all influence ordering. A sorted receipt must name its policy; a database key needs an explicit versioned contract.