Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Compare user text safely when characters can have multiple representations.
Unicode Normalization is easiest to learn by reading the example, changing it, and observing the result.
// "é" can be ONE code point or "e" + a combining accent.
const composed = 'café'; // é = U+00E9
const decomposed = 'café'; // e + U+0301
console.log(composed === decomposed); // false!
console.log(composed.length, decomposed.length); // 4 vs 5
// Normalize before comparing or storing
console.log(composed.normalize('NFC') === decomposed.normalize('NFC')); // truePractice the Unicode Normalization example in a small scratch file, then explain what changed and why.