Counting
Code point
A → U+0041
😀 → U+1F600A numbered Unicode value; a visible symbol can contain several code points.
Encoding reference
Distinguish bytes, code units, code points and visible graphemes when counting or encoding international text.
8 of 8 entries
Counting
A → U+0041
😀 → U+1F600A numbered Unicode value; a visible symbol can contain several code points.
Counting
'😀'.length === 2JavaScript string length counts UTF-16 code units, not user-perceived characters.
Counting
Array.from('😀').length === 1String iteration groups surrogate pairs but does not combine multi-code-point graphemes.
Counting
e + U+0301 → éA combining accent can join a letter into one user-perceived text unit.
Encoding
é → C3 A9
😀 → F0 9F 98 80UTF-8 encodes a Unicode scalar value using one to four bytes.
Normalization
'é'.normalize('NFC') === 'é'NFC composes canonical equivalents where possible; it does not remove accents.
Normalization
'①'.normalize('NFKC') === '1'NFKC folds compatibility distinctions; apply it only when losing those distinctions is acceptable.
Encoding
Text → UTF-8 bytes → Base64Base64 represents bytes. Agree on a text encoding when decoding them back to text.