marmelroy / Zip

Swift framework for zipping and unzipping files.
MIT License
2.51k stars 453 forks source link

Compressed files in Windows under the extract, including the Chinese file will be garbled #77

Open shalyf opened 7 years ago

shalyf commented 7 years ago

Such as title

mostafaberg commented 7 years ago

Not enough information to reproduce anything, please post more information with examples

shalyf commented 7 years ago

Files_downloaded_by_AirDroid.zip This file(contains two image file: 中文名1.jpg, 中文名2.jpg) is compressed with Zip.zipFiles(paths:zipFilePath:password:progress:). It opened under the macOS is normal, but in Windows will be garbled.

mostafaberg commented 7 years ago

Do you have a screenshot on what it looks like in windows ?

shalyf commented 7 years ago

Wait a moment, I can not upload screenshots now

shalyf commented 7 years ago

b170212888aebdb8ab6d0966d3bdd55e 221d2311af89377bccbf18a413ccfd1c

mostafaberg commented 7 years ago

I can see the same too, seems like I'm getting different characters too. since it works on OSX i would guess maybe it has something to do with the windows environment ?

shalyf commented 7 years ago

This is the information I found: macOS system comes with the compression program on the zip file name UTF-8 encoding, but the zip file header does not declare PKZIP high version of the enhanced Unicode bit. Windows will think that the file name is ANSI encoding, the results show garbled.

mostafaberg commented 7 years ago

That's a good find. for the time being until someone can look into this you can use ASCII filenames as a workaround?

shalyf commented 7 years ago

thx, but the file name is not what I can decide.