6.0.0-git
2019-03-21

[#7609] Unicode support in ZIP
Summary Unicode support in ZIP
Queue Horde Framework Packages
Queue Version Git develop
Type Enhancement
State Accepted
Priority 1. Low
Owners
Requester freecityhk (at) gmail (dot) com
Created 2008-10-30 (3794 days ago)
Due
Updated 2013-08-05 (2054 days ago)
Assigned
Resolved
Milestone
Patch No

History
2013-08-05 22:34:17 Michael Slusarz Comment #7
Version ⇒ Git develop
Reply to this comment
It is just implemented by setting the reserved bit 11 in general 
purpose bit flag
This is not 100% true.  There is also an additional "comment field" 
method of storing UTF-8 data, as defined by Info-ZIP.  So that would 
need to be implemented as well.

As mentioned in a previous ticket... I would really like to see us get 
out of the compression library business.  I would much rather use an 
existing library that handles all these details for us.  ZipArchive 
would be perfect... except the pecl module seems to be broken (at 
least it doesn't work for me on PHP 5.4, either stable or beta 
version).  And requiring built-in zip support to PHP seems to be too 
invasive/too big of a step back from the present situation.
2008-11-21 03:01:36 caltuslex (at) hotmail (dot) com Comment #6 Reply to this comment
Did this solution work?
2008-11-02 03:50:40 Chuck Hagenbuch State ⇒ Accepted
Version ⇒ HEAD
 
2008-11-01 09:56:47 freecityhk (at) gmail (dot) com Comment #5 Reply to this comment
So, we just need to make sure that in Compress_Zip, we call
convertCharset on filenames to make them utf-8 if they aren't already
- that sound right?
yes
2008-11-01 03:17:58 Chuck Hagenbuch Comment #4 Reply to this comment
So, we just need to make sure that in Compress_Zip, we call 
convertCharset on filenames to make them utf-8 if they aren't already 
- that sound right?
2008-10-31 08:07:46 freecityhk (at) gmail (dot) com Comment #3 Reply to this comment
It seems to be the same request



Maybe I explain it further

Zip format add Unicode filename support in version 6.3.0

(which works under WinZip 11.2+, WinRAR 3.8+, 7-Zip 4.58+)

http://en.wikipedia.org/wiki/ZIP_(file_format)#6.3



It is just implemented by setting the reserved bit 11 in general 
purpose bit flag

http://www.pkware.com/documents/casestudies/APPNOTE.TXT

Then the filename and comment fields must be encoded using UTF-8.



Since Horde using UTF-8 by default, then everything works and just 
setting this flag



ps. Zip version 6.3.2 implements an extra field for the storage of the 
Unicode filename which I believe not useful in this case, and lead to 
a more complicated implementation.
2008-10-31 00:13:20 Chuck Hagenbuch Comment #2
State ⇒ Feedback
Reply to this comment
This looks like a duplicate of #1841 to me, except with a solution - 
can you please look and let me know if this is the same issue?
2008-10-30 10:38:17 freecityhk (at) gmail (dot) com Comment #1
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ Unicode support in ZIP
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
Should we set set General purpose bit flag to 0008 in 
horde/lib/Horde/Compress/zip.php to support Unicode Filename in the 
"Zip all attachment and download" feature



horde/lib/Horde/Compress/zip.php



replace

         $cdrec .= "\x00\x00";                /* General purpose bit flag */

to

         $cdrec .= "\x00\x08";                /* General purpose bit flag */



and



replace

         $fr .= "\x00\x00";           /* General purpose bit flag. */

to

l        $fr .= "\x00\x08";           /* General purpose bit flag. */

Saved Queries