Character Encodings

Base64, URL encoding and UTF-8 explained plainly.

Character Encodings is taught here in 14 lessons, running from Base64 encoding through to Compression vs encoding: gzip, deflate and Brotli. Each lesson takes one topic, shows the working code, and links onward to the next, so the course can be read straight through in order.

TrackComputer Science Fundamentals
Lessons14
LevelBeginner to intermediate
Reading timeabout 3 hours
PrerequisitesHelpful, but not required: Operating Systems

Lessons

  1. Base64 encodingWhat Base64 is, why it exists, how it works, and the cases where it is the wrong tool.
  2. URL encoding (percent-encoding)Why spaces and symbols in a URL get turned into %20 and friends, and the difference between query and path encoding.
  3. UTF-8 and character setsWhy 'one character = one byte' is wrong, what code points are, and how UTF-8 became the default for the web.
  4. Bytes, bits, hex and number basesBinary and hex notation, byte ranges, converting between bases by hand and in code, and how to read a hex dump without confusing offsets with data.
  5. Character sets: ASCII, Latin-1 and Windows-1252ASCII as a 7-bit standard, how the high 128 positions became a collision zone between Latin-1 and Windows-1252, and why legacy text breaks when it moves between systems.
  6. HTML entities and escaping in markupNamed and numeric character references, which characters must be escaped where, and how double-escaping turns one mistake into visible garbage in production.
  7. Form encoding vs percent-encodingurlencoded and multipart bodies, when a plus sign means a space, how servers parse each content type, and the double-decoding bugs that hide in request handling.
  8. Unicode in depth: planes, properties and normalisationBMP and supplementary planes, surrogate ranges, combining marks, and the four normalisation forms that decide whether two visually identical strings are equal.
  9. UTF-16, UTF-32, BOM and endiannessCode units versus code points, surrogate pairs, what a byte order mark really is, why Windows and Java default to UTF-16 internally, and when a BOM helps or hurts.
  10. Escape sequences across languagesJSON and JavaScript escapes, C and Python string literals, shell quoting, and the double-decoding mistakes that happen when two escape systems meet.
  11. Mojibake: diagnosing and fixing broken textRecognising the classic UTF-8-read-as-Latin-1 damage, recovering the original bytes, finding the wrong decode point, and preventing the bug from returning.
  12. Quoted-printable, MIME and email encodingWhy email needs its own encoding layer, how encoded words in headers work, when a body is base64 rather than quoted-printable, and the line length limits that cause silent breakage.
  13. Punycode and internationalised domain namesHow IDNA turns a Unicode label into ASCII, the difference between the display name and the wire form, and why homograph domains are a security problem rather than a curiosity.
  14. Compression vs encoding: gzip, deflate and BrotliContent coding is a representation choice, not encryption, how negotiation works over HTTP, why compressing secrets can leak them, and how to choose an algorithm.

More in Computer Science Fundamentals

Algorithms Data Structures Computer Networks Operating Systems Hashing & Checksums Data Formats Dates & Time Regular Expressions

FAQ

How long does the Character Encodings course take?
It has 14 lessons, about 3 hours of reading. Expect roughly twice that if you type out and run every example.
Do I need prior experience for Character Encodings?
Not strictly. It helps to have read Operating Systems first, because some lessons build on it, but every lesson explains its own assumptions.
What should I read after Character Encodings?
Continue with Hashing & Checksums (14 lessons), the next course in Computer Science Fundamentals.