3 ms·
Another issue with zip files on OSX: > Zip files can encode their file names in two ways: CP437, or unicode. > Each operating system does it wrong, but in a d
by nicbou 5y ago
Another issue with zip files on OSX:
> Zip files can encode their file names in two ways: CP437, or unicode.
> Each operating system does it wrong, but in a different way. For instance, Mac OS encodes its zip files as unicode, but doesn't set bit 11 correctly, so Python (correctly) reads them as CP437, and garbles the non-ASCII characters in file names.
> I wrote a quick and dirty workaround for Mac OS archives: if the file doesn't exist, encode the name as CP437 and check again. I'll think of something more clever if I ever switch to another OS.
https://nicolasbouliane.com/projects/timeline https://nicolasbouliane.com/projects/timeline
- jeroenhd 5y agoWoah, that explains a lot of weird bugs, actually! This is very useful information, thanks!