June 12, 2026 · Yunus Emre Vurgun
TOON Encoder Quirks: Six Edge Cases Worth Knowing
Most encoders get the happy path right. The interesting failures live at the edges. These are the six we have hit in production.
1. Empty cells
Encode as a single space between tabs (a[space][tab][space]b). Do not collapse to a double tab; that is a different cell count.
2. Embedded newlines
Wrap the cell in double quotes. Escape \n literally. The parser must unescape on read.
3. Numeric precision
TOON does not encode types; 1, 1.0, and 1e0 are all distinct strings. The encoder must pick one and document it. We pick the shortest exact form.
4. Trailing whitespace
Stripped by the encoder. Parsers should treat "a " and "a" as identical after unquoting.
5. Unicode normalization
Encode in NFC. NFC and NFD of the same string hash differently and look the same in a diff. One canonical form, please.
6. Comments at the end of a row
Forbidden. If you need a comment, put it on its own line. A trailing # ... in a row is a parser ambiguity we do not want.