delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/11/01/01:04:11

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:reply-to:subject:to
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=KWo2GKo82eDMVUKA4Ab74WrCGIwDmPNdvM7mIL8n7xxSiGaWqKVk7
9f6C1enIu0pdG68o02PeQ2SnWAN3DMFJEL98+LRoW5xn3Udqz+qr00UGqDLXeYjY
cN7uL0soJNcqy+6WKkk83kbk5hPjMz9kFaKQ6zBz+B9MrHhfVp6MaI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:reply-to:subject:to
:mime-version:content-type:content-transfer-encoding; s=default;
bh=fwtDLsGO+oQx4z6sISgZNhLJOQw=; b=RyC6wg7Mw1I8s9loPGyH8T1n2AcF
J3f0TG06beivXyiueW9Cu5ZU8XKJAlOazhIybH8Sg9xzX483B+3crpUwJjUeOPAS
/sv8Q8Blov4D/Ni7EtZnlkD3YZknAzneeMh2D/8Jl4Gue9ZJA8cEVY2dyBNu5vlE
acmmKu4hKl2UQvs=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=4.1 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,FREEMAIL_FROM,GARBLED_BODY,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=no version=3.3.2
X-HELO: nm43-vm4.bullet.mail.ne1.yahoo.com
Message-ID: <1414818040.70941.YahooMailNeo@web122101.mail.ne1.yahoo.com>
Date: Fri, 31 Oct 2014 22:00:40 -0700
From: Brent <yhbrent AT yahoo DOT com>
Reply-To: Brent <yhbrent AT yahoo DOT com>
Subject: bug/deficiency in zip: non-ascii chars in file names work, but fail in directory names
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>
MIME-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id sA1548Do005178


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


- Raw text -


  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019