Javascript ♥ Unicode
summary
JavaScript treats many Unicode code points as two UTF‑16 surrogates, so string.length and character-at semantics are misleading (a pile of poo counts as length 2 and caused Twitter’s counter bug, effectively limiting tweets to 70 such emoji). ES6/ES7 add fixes: Array.from / spread + string iterator, String.fromCodePoint and codePointAt, string.normalize, new Unicode escapes and the u flag for regex. Tools: regenerate for building Unicode regexes, a rigex transpiler, s-reverse and punycode ports — they work but add complexity.
AI-written summary · about
chapters (23)
- 0:00Welcome
- 0:41Speaker and Punic code
- 2:48JS Unicode quirks
- 3:52Unicode basics
- 6:42Unicode planes and symbols
- 8:04Encodings and Unicode
- 10:32JS string escapes
- 12:20Astral symbols in JS
- 14:24Why JavaScript string length is misleading
- 16:52Unicode bugs in real world
- 18:14Counting code points
- 20:19Combining marks and strings
- 21:21Normalizing strings
- 22:45Reversing strings
- 24:29String methods limits
- 27:21Iterating Unicode symbols
- 29:05Regular expressions and Unicode in JavaScript
- 33:58ES6 regex Unicode flag
- 35:42Unicode ranges in regex
- 36:24Transpiling Unicode regex
- 37:48Future Unicode regex
- 39:56Fix Unicode issues
- 40:59Q&A








