Skip to content

Resources

Level: reference · for anyone

External material worth your time, by what it is good for. Everything here is somebody else's work — this library links to it and does not reproduce it. Where a page here was prompted by one of these, the page says so and the code and prose are written from scratch.

The primary sources

Python's own documentation

Real Python

Subscription material, and good. Cited here as sources rather than summarized:

Other languages' FAQs

Old, free, and written by people who had already met the problem. Cited as sources; nothing is run and nothing is copied.

  • perlfaq5 — Files and Formats ↗ — forty-two questions about file I/O, and the source of four of the six sections in Opening a file: flushing an output handle, counting the lines in a file, why opening read-write wipes it out, and renaming a file reliably. The topics transfer; the Perl does not, and none of it is reproduced here. Its companion perlpacktut ↗ is still on the backlog as the struct / to_be_bytes / fixed-width-field page.

Microsoft's .NET documentation

Free, and worth reading even if you never write C#, because .NET names distinctions Python leaves implicit. Cited as sources; nothing here is reproduced.

macOS specifics

The two pages behind Filenames are not text's macOS half. Both are about the terminal, not about Python, and neither is the source of a number on that page — every measurement there was re-run on 2026-09-06 against Linux, because both pages predate APFS.

  • Display high-bit characters in Terminal on Mac ↗ — Apple. The Terminal profile's text-encoding menu and its "set locale environment variables on startup" checkbox. Read it for what the three settings are; the advice to change them is for a world that is no longer the default.
  • Terminal Primer – Part 3 – Special Characters ↗ — Armin Briegel. Shell quoting and escaping, not encodings — but it is where the Finder / ↔ shell : swap is best explained. Written for bash in 2017; its ! and single-quote rules do not hold in fish.

Talks

  • Ned Batchelder, Pragmatic Unicode ↗ — the "unipain" talk. Still the clearest statement of the boundary discipline, and the source of the encode on the way out, decode on the way in framing.
  • Bob Steagall, Fast Conversion From UTF-8 ↗ — CppCon 2018. Not Python, but the clearest visual account of how UTF-8 decoding actually works.

The sibling libraries