bug/deficiency in zip: non-ascii chars in file names work, but fail in directory names

Brent yhbrent@yahoo.com
Sat Nov 1 05:03:00 GMT 2014



It seems that cygwin's zip can archive files whose name includes non-ascii (unicode) chars just fine, but if you try to archive a directory whose name includes such chars, it fails.


First, I am using the very latest release of cygwin 64 bit:
    $ uname -a
    CYGWIN_NT-6.1 yhbrent 1.7.32(0.274/5/3) 2014-08-13 23:06 x86_64 Cygwin
And when I installed from setup-x86_64.exe, I added the zip and unzip programs from the Archive section.  Running setup-x86_64.exe just now, I see that the version numbers of what I have installed are:
    zip: 3.0-12
    unzip: 6.0-1


Consider this cygwin shell session I just did:

    $ ls -l
    -rwx------+ 1 samsmith None 2048 Oct 31 08:32 㐀丁龦豈侮.txt
    
    $ zip test.zip 㐀丁龦豈侮.txt
      adding: 㐀丁龦豈侮.txt (stored 0%)
    
    $ echo $?
    0
    
    $ mkdir tmp
    
    $ mv test.zip tmp
    
    $ cd tmp
    
    $ unzip test.zip
    Archive:  test.zip
     extracting: ???????????????.txt
    
    $ echo $?
    0
    
    $ ls -l
    total 8
    -rw-r--r--+ 1 samsmith None 2236 Nov  1 00:36 test.zip
    -rwx------+ 1 samsmith None 2048 Oct 31 08:32 㐀丁龦豈侮.txt
    
    $ diff ../㐀丁龦豈侮.txt 㐀丁龦豈侮.txt
    [nothing printed out]
    
In other words, I have a file named 㐀丁龦豈侮.txt, zip successfully archived it, and unzip successfully extracted it (hmm, unzip did print all those ? chars...), and diff proved that the extracted file's contents are the same as the original.  SO FAR, SO GOOD.


Now suppose that that file 㐀丁龦豈侮.txt is inside a directory named åØâéñ, and that I attempt a similar procedure as above, but on the directory instead:

    $ ls -l åØâéñ
    total 4
    -rwx------+ 1 samsmith None 2048 Oct 31 08:32 㐀丁龦豈侮.txt
    
    $ zip test.zip åØâéñ
      adding: åØâéñ/ (stored 0%)
    
    $ echo $?
    0
    
    $ mkdir tmp
    
    $ mv test.zip tmp
    
    $ cd tmp
    
    $ unzip test.zip
    Archive:  test.zip
       creating: ??????????/
    
    $ echo $?
    0
    
    $ ls -l åØâéñ
    total 0
        
So, zip only archived the åØâéñ directory, and unzip successfully extracted the directory, BUT THE FILE 㐀丁龦豈侮.txt INSIDE THE ORIGINAL åØâéñ DIRECTORY FAILED TO BE INCLUDED IN THE ARCHIVE AS IT OUGHT TO HAVE BEEN.



Incidentally, I observe the exact same behavior when I tried the operations above inside an Xubuntu 14.04 virtual machine just now.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list