JavaScript ♥ Unicode
summary
JavaScript stores characters as UCS‑2/UTF‑16 so many emoji and astral code points become surrogate pairs and break length, reverse and regex logic — a real bug once limited tweets to ~70 piles of poo. Workarounds shown include using Array.from, String.fromCodePoint, codePointAt, for‑of iteration, Unicode normalization (unorm) and libraries: Punycode, regenerate, and the regexpu compiler that rewrites ES6 /u regular expressions to ES5. ECMAScript 6 features make correct handling far simpler.
AI-written summary · about
chapters (8)
- 0:00Start
- 8:10Surrogate pairs
- 12:23JavaScript escape sequences
- 13:38Unicode normalization
- 15:28Reversing a string in JavaScript
- 18:28Iterate over all symbols in a string
- 21:24Create Unicode-aware regular expressions
- 24:21Unicode regex transpiler








