6.0.0-alpha10
5/14/25

[#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 10/30/2008 (6040 days ago)
Due
Updated 08/05/2013 (4300 days ago)
Assigned
Resolved
Milestone
Patch No

History
08/05/2013 10:34:17 PM 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.
11/21/2008 03:01:36 AM caltuslex (at) hotmail (dot) com Comment #6 Reply to this comment
Did this solution work?
11/02/2008 03:50:40 AM Chuck Hagenbuch State ⇒ Accepted
Version ⇒ HEAD
 
11/01/2008 09:56:47 AM 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
11/01/2008 03:17:58 AM 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?
10/31/2008 08:07:46 AM 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.
10/31/2008 12:13:20 AM 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?
10/30/2008 10:38:17 AM freecityhk (at) gmail (dot) com Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ Unicode support in ZIP
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ New
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