Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Learn the fixed-width encoding and its trade-offs.
UTF-32 is easiest to learn by reading the example, changing it, and observing the result.
// UTF-32 uses a fixed 4 bytes for every code point.
// Simple to index, but wastes space for mostly-ASCII text.
const text = 'Aあ😀';
const codePoints = [...text].map(c => c.codePointAt(0));
console.log(codePoints); // [65, 12354, 128512]
console.log('Code points:', codePoints.length, '| UTF-32 bytes:', codePoints.length * 4);Practice the UTF-32 example in a small scratch file, then explain what changed and why.