Handle Unicode text, emoji, encoding, normalization, code points, and safe storage.
Lessons
Pick collations for correct comparison and sorting.
Database Collations is easiest to learn by reading the example, changing it, and observing the result.
const names = ['Zoé', 'apple', 'Ähnlich', 'banana'];
// Locale-aware, case-insensitive sorting
const collator = new Intl.Collator('de', { sensitivity: 'base' });
console.log(names.sort(collator.compare));
// Case-insensitive compare across scripts
console.log('STRASSE'.localeCompare('straße', 'de', { sensitivity: 'accent' }));Practice the Database Collations example in a small scratch file, then explain what changed and why.