How to Become an Encoding Champion
summary
Explains why encoding causes real bugs and how to fix them: Ruby’s encode vs force_encoding distinction (encode rewrites bytes irreversibly, force_encoding only reinterprets) solves the author’s bug where a response arrived as ASCII-8BIT despite a UTF-8 request; shows using bytesize, bytes, ord and chr to inspect data; cites UTF-8 adoption >94% of pages and Unicode 137,929 characters (May 2019); covers Base64 behavior: encode64 inserts linefeeds every 60 chars unless strict is used and strict_decode raises an error.
AI-written summary · about
chapters (11)
- 0:00Intro
- 1:20What is Encoding
- 2:55Encoding vs Decoding
- 3:59Encoding Basics
- 8:26ASCII
- 10:54Unicode
- 19:59Encoding
- 27:03Base64
- 29:32Strict
- 31:00Things to Remember
- 31:52Outro
related talks
38mInvalid byte sequence in UTF-8
11mLightning Talk: Encoding - Understanding the Basics
34mThe Three-Encoding Problem
28mMaking Acquaintances with Exotic Encodings
54mSTRINGS ATTACHED: FROM ASCII TO 🙊🙈🙉
40mUnicode: The hero or villain?
05mLet's start at the beginning - bits to character encoding in R
48mUnicode: Going Down the Rabbit Hole
