ZipArchive
ZipArchive copied to clipboard
File names with chinese are messed up at 2.1.2
Unzip files with password. File names with chinese are messed up. Unzip the same files by version 2.1.1, File names are correct.
@DamonChen117 This is caused by @palmin pull request #443 that is applying specs.
Could you give us a sample zip file with the issue? Also, please specify which tool was used to generate the archive. Then, we'll have to discuss if: a) it's a bug with ZipArchive b) it's a problem with an archive flag itself (did you really made the archive on MS-DOS FAT or FAT32?), and we need to workaround it. c) it's a problem with an archive flag itself (did you really made the archive on MS-DOS FAT or FAT32?), and we will not workaround it, but suggest you to use a correct zipping tool that follows the specs and flags the system used (UNIX, mac OS, Windows NTFS, etc.) correctly.
The Pet Store.zip The file name of the mp3 should be 朗读版.mp3 The file was zipped by ZipArchive 2.1.1 on Mac OS. Password:nomaD 8102 thgirypoC
Thanks, if it's our own tool that is causing the issue, it's a big problem. But please allow one day for me to investigate: I'm currently busy in office.
This problem have any progress? @DamonChen117 @Coeur
It might be a good idea to have a flag/option to turn on legacy cp437 encoding of filenames in zip. Lots of zip implementers including me in the past didn't seem to make an exception for cp437 and have just used utf-8 without setting the utf-8 flag.
There is a good article on this: https://marcosc.com/2008/12/zip-files-and-encoding-i-hate-you/
It's still on my TODO list. Sadly, I'm busy until iOS 12 release, so it will happen after it.
Seems this issue still exists I replaced kCFStringEncodingDOSLatinUS with NSUTF8StringEncoding but not works any idea ?
OK , it's not SSZipArchive issue , SSZipArchive can zip and unzip Chinese named files correctly (after replacement) , it's my fault ,I use mac zip app : unarchiver , when I unzip the zip file contains Chinese named file , it ask me choose an encoding target , I didn't choose UTF8 ,so the name messed up , SSZipArchive is awesome BTW.