Why more than one encoding exists for the same character set
UTF-8, UTF-16, and UTF-32 all represent the same underlying Unicode code points but trade off differently between storage efficiency and processing simplicity. UTF-8 stays compact for English-heavy text and is dominant on the web; UTF-16 is baked into older platform APIs like Windows and Java, which is why both remain in wide use rather than one replacing the other.
Why an emoji sometimes "is" several code points at once
Many modern emoji, like a specific skin-tone thumbs-up or a family emoji, are actually a sequence of multiple code points joined with a special zero-width joiner character, rendered by supporting software as one glyph. This is why some emoji look identical but have a longer underlying code point sequence than others.
Frequently Asked Questions
Why does a string's character count sometimes not match its byte length?
Because encodings like UTF-8 use a variable number of bytes per character β a string with only ASCII letters has character count equal to byte count, but adding accented letters, CJK text, or emoji increases the byte length faster than the visible character count.
What is a surrogate pair, in plain terms?
It is a way for UTF-16 to represent a character that doesn't fit in its normal 2-byte unit, by using two special 2-byte units together as a single combined unit. Software that mistakenly treats each half as its own character can split an emoji or rare character in half and corrupt it.