This is the mail archive of the
cygwin
mailing list for the Cygwin project.
bug/deficiency in zip: non-ascii chars in file names work, but fail in directory names
- From: Brent <yhbrent at yahoo dot com>
- To: "cygwin at cygwin dot com" <cygwin at cygwin dot com>
- Date: Fri, 31 Oct 2014 22:00:40 -0700
- Subject: bug/deficiency in zip: non-ascii chars in file names work, but fail in directory names
- Authentication-results: sourceware.org; auth=none
- Reply-to: Brent <yhbrent at yahoo dot com>
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