~/talk

Unicode in JavaScript

Talkat Wildcard Conference 2013 · on Friday, 2013-09-13· [javascript]
slides:none on file

JavaScript represents astral Unicode as surrogate pairs, so many symbols (emoji, math alphas, pile of poo) consume two code units and string.length counts halves, breaking counters, reversing, substring and regex expectations. Workarounds include normalizing combining sequences and iterating code points rather than code units, polyfills that implement String.fromCodePoint and codePointAt, and tools that generate Unicode-aware regex. ECMAScript 6 adds for‑of, normalization and a Unicode /u flag to fix many issues.

AI-written summary · about

  1. 0:00Start
  2. 5:59Hexadecimal escape sequences
  3. 6:53Unicode escape sequences
  4. 8:01Unicode code point escapes
  5. 8:32Surrogate pairs
  6. 10:00JavaScript string length
  7. 11:28Real-world example
  8. 13:19JS string character count
  9. 14:21If we're being pedantic...
  10. 15:50Unicode normalization
  11. 16:46Reversing a string in JavaScript
  12. 20:42Iterate over all symbols in a string
  13. 21:24More string madness
  14. 21:56Match any Unicode symbol
  15. 22:57Create Unicode-aware regular expressions
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.