Encoding and Unicode Pack

Encoding bugs do not throw. They produce wrong text and carry on, and the damage usually surfaces in a different system days later. This pack makes each failure mode reproducible in one step.

↓ Download encoding-unicode-pack.zip17 files · 10.8 KB zipped

SHA-256 9d62d955fc122113b2d27872b58f1353da1acc2073a023a63f64d16cbfd50646

What is inside

FileFormatSizeExpected result
utf8-no-bom.txtTXT99 bytesThe baseline. Everything else is compared against this.
utf8-with-bom.txtTXT102 bytesBOM stripped before parsing, not treated as part of the first value.
utf16le.txtTXT162 bytesDetected as UTF-16 LE from the FF FE mark and decoded correctly.
utf16be.txtTXT162 bytesDetected as UTF-16 BE from FE FF. Assuming little-endian reads garbage.
latin1.txtTXT43 bytesDecoded as Latin-1, not assumed to be UTF-8 and mangled.
zero-width-and-rtl.txtTXT94 bytesInvisible characters detected and stripped or rejected, not stored.
line-endings-crlf.txtTXT1.0 KBCRLF handled without leaving a stray carriage return on every value.
line-endings-lf.txtTXT1.0 KBThe LF control for the CRLF case.
bom-and-semicolons.csvCSV124 bytesFirst column named id, not id. Delimiter sniffed, not assumed.
nfc-café.txtTXT142 bytesNormalised to NFC on the way in.
nfd-café.txtTXT142 bytesRecognised as the same name as the NFC copy, not stored twice.
файл-кириллица.txtTXT142 bytesNon-Latin filename round-trips unchanged.
日本語ファイル名.txtTXT142 bytesSame, in a script that needs three bytes per character in UTF-8.
🦊-emoji-name.txtTXT142 bytesAstral-plane characters survive. Length checks count the right unit.
unicode-entry-names.zipZIP563 bytesEntry names decoded as UTF-8 via the flag bit, not the local code page.
unicode-headers.emlEML427 bytesRFC 2047 encoded-word subject decoded rather than shown raw.
quoted-printable.emlEML535 bytesQuoted-printable body decoded, soft line breaks removed.
Also in the archive: a README.md repeating this table with full digests, a manifest.json for scripting, and a SHA256SUMS you can check with sha256sum -c. Every file is generated from source, carries no third-party copyright, and is free to redistribute.

Questions

What is a BOM and why does it break my CSV?

A byte-order mark is an invisible marker at the start of a file declaring its encoding. A parser that does not strip it sees the first column named "id" instead of "id", so the import fails on exactly one field while the header looks perfect in every editor. The pack has the file that reproduces it.

How do I test for mojibake?

Feed the Latin-1 and UTF-8 files through the same path and compare the output. If the UTF-8 one comes back as café something decoded it as Latin-1. If the Latin-1 one comes back with replacement characters something assumed UTF-8. Both are in the pack.

What are NFC and NFD?

Two valid ways to write the same accented text. NFC composes é into one code point; NFD splits it into e plus a combining accent. They render identically and compare as unequal, which is how the same filename ends up stored twice. Both versions are in this pack.

Other packs

Upload Torture Test Pack · Filename Compatibility Pack · Archive and ZIP Security Pack · Document Parser Pack · Image Pipeline Pack · Structured Data Pack · Email Parser Pack