zip 1.8.0 can add empty dir, php6 zip initial unicode support
Posted by Pierre in
PHP
Thursday, November 2. 2006
Zip 1.8.0 has just been released. It is now possible to create empty directory in an archive using the addEmptyDIr method.
A couple of other bugs have been fixed:
- Fixed setComment when used with a freshly added entry
- Fixed a possible leak in statName and statIndex
- setComment now returns the expected value, true on success and false on failure (Thanks Hannes Magnusson)
While checking the unicode stream support in php, I finally commited the initial support unicode for zip in HEAD (PHP6). The zip format works with the codepage 437 (or other cp, some OS may support them), which is basically ASCII with some additions. That’s why I choosed the safest way and convert entry names to ascii/binary.
It is always a pain to work with other charsets in zip archives, no matter which tools or library you use. Winzip or its windows brother may even refuse to read an archive containing unicode filenames. Hopefully adding 7zip support will solve this issue as it supports unicode names.
I’m looking for some Zip archives with non ascii entry names (like cp932, 949, 864, 855 or 950), it will help me to finish the implementation. Ideally the API should return entry names as unicode string to be truly portable. If you have some or you can create one, please put it somewhere online and put the link in a comment, thank you ![]()
As always, comments and feedbacks are welcome ![]()



