ZipArchive icon indicating copy to clipboard operation
ZipArchive copied to clipboard

File names with chinese are messed up at 2.1.2

Open DamonChen117 opened this issue 6 years ago • 8 comments

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 avatar Apr 09 '18 06:04 DamonChen117

@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.

Coeur avatar Apr 09 '18 09:04 Coeur

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

DamonChen117 avatar Apr 10 '18 01:04 DamonChen117

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.

Coeur avatar Apr 10 '18 02:04 Coeur

This problem have any progress? @DamonChen117 @Coeur

congWang-1015 avatar May 08 '18 06:05 congWang-1015

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/

nmoinvaz avatar Aug 27 '18 15:08 nmoinvaz

It's still on my TODO list. Sadly, I'm busy until iOS 12 release, so it will happen after it.

Coeur avatar Aug 27 '18 15:08 Coeur

Seems this issue still exists I replaced kCFStringEncodingDOSLatinUS with NSUTF8StringEncoding but not works any idea ?

FlashTang avatar Jan 08 '19 02:01 FlashTang

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.

FlashTang avatar Jan 08 '19 02:01 FlashTang