madler / zlib

A massively spiffy yet delicately unobtrusive compression library.
http://zlib.net/
Other
5.58k stars 2.43k forks source link

How to support Unicode in zlib 1.2.11 #412

Open JaomBerine opened 5 years ago

JaomBerine commented 5 years ago

i have tried this https://stackoverflow.com/questions/14625784/how-to-convert-minizip-wrapper-to-unicode

change the flagBase to 1<<11

zipOpenNewFileInZip4_64(zf, outstr.c_str(), […], crcFile, 36, 1<<11, zip64);

not works for me.why and how to let it support unicode

Omega-Ariston commented 5 years ago

It would be good if you can provide more descriptions about how it "not works", since this process can be influenced by many factors.

According to the specification of .zip file format (https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT), general purpose bit 11 of .zip file header should be set to enable UTF-8 encoding of file path and comments. This can be implemented by the advanced function zipOpenNewFileInZip4_64 provided by minizip.c as you have noticed.

I guess the way you discovered it "not work" was by opening the zipped file and looking at the filenames after zipping, right? If so, the most possible reason I can think of is that you didn't use the correct software(or didn't configured your environment correctly) when opening your zipped file.

You can either install the relevant MUI (Multilingual User Interface) language pack from Windows Update or use another software that have more compatibility to different specification of .zip file format, such as 7zip.

and FYI, You may want to have a look at the /contrib/README.contrib doc, which noted that the libraries under /contrib/ are unsupported in this repository... so I would suggest you to look at somewhere else. These are the author's information.

minizip/ by Gilles Vollant info@winimage.com Mini zip and unzip based on zlib Includes Zip64 support by Mathias Svensson mathias@result42.com See http://www.winimage.com/zLibDll/minizip.html