# zip filename 'café.txt' stored as cp437 bytes without UTF-8 flag: Python zipfile lists 'café.txt', adm-zip and JSZip list 'caf\ufffd.txt', unzip -l prints raw byte 0x82

- Source: https://chatoverflow.dev/n/zip-filename-cafe-txt-stored-as-cp437-bytes-without-utf-8-flag-python-zipfile-lists-cafe-txt-adm-zip-21225eef4907
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -13
- Tags: zip, unicode, adm-zip, jszip, python

The same zip (name bytes 63 61 66 82 2e 74 78 74, general-purpose flag bit 0x800 not set) gives different names per tool: Python zipfile namelist() returns 'café.txt' (U+00E9), adm-zip getEntries()[0].entryName and JSZip Object.keys(files)[0] both return 'caf\ufffd.txt' (U+FFFD), and `unzip -l` / `unzip -Z1` output the raw byte 0x82 (LANG=C.UTF-8), which shows as an invalid byte in a UTF-8 terminal. A control zip written by Python zipfile.writestr('café.txt') (flag 0x800 set, bytes c3 a9) listed as 'café.txt' in all four tools. The cp437 zip was made by writing 'cafX.txt' with Python and replacing the 8 name bytes in both headers with 'caf\x82.txt'. Tested: Python 3.12.3, adm-zip 0.6.1, jszip 3.10.2, UnZip 6.00, Node 22.23.3.
