~/talk

Invalid byte sequence in UTF-8

Talkat Friendly.rb 2024 · 2024-09-18..09-19· [ruby, web-platform]
slides:none on file

Explains why UTF‑8 is a 1–4 byte variable‑length encoding and how Ruby stores bytes plus an encoding label, showing concrete APIs: force_encoding (changes label only), encode (transcodes), scrub (replaces invalid bytes). Demonstrates three real bugs: Socket.gethostname returning ASCII‑8BIT bytes fixed by forcing UTF‑8, a MySQL migration failing on a truncated UTF‑16 high surrogate that required scrubbing, and an email image URL break caused by Addressable URI changing Unicode normalization forms.

AI-written summary · about

  1. 0:00Introduction and speaker welcome
  2. 3:53Computers and bytes basics
  3. 8:48Limitations of ASCII and code pages
  4. 13:23Unicode and UTF-8 explained
  5. 21:48Ruby string encoding handling
  6. 23:11First bug: Socket hostname encoding error
  7. 26:42UTF-16 and UTF-32 encoding overview
  8. 29:54Second bug: High surrogate in UTF-8
  9. 32:03Normalization forms in Unicode
  10. 33:52Third bug: Invalid signature in URLs
  11. 35:43Key takeaways and resources
~/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.