Comment 12 for bug 1422290

Revision history for this message
Nobuto Murata (nobuto) wrote :

I have sent an enhancement request to upstream through http://www.info-zip.org/zip-bug.html since the issue is still reproducible with 6.1c19-BETA which you can try from: https://launchpad.net/~nobuto/+archive/ubuntu/build-test/+build/7630500

Putting a copy of the request here for your reference.

====

This is an enhancement request. Thanks to ICONV_MAPPING(-O/-I options), we can specify character encoding when extracting zip files. However in combination with GUI application(e.g. file-roller on Linux), there is no way to specify -I/-O from a user perspective. Therefore We cannot extract zip files created on localized Windows system properly with GUI.

A workaround would be exporting UNZIP and ZIPINFO variables with "-O <local charset on Windows>" per locale on login by putting [1] under /etc/profile.d/.

[1] http://bazaar.launchpad.net/~nobuto/ubuntu/vivid/unzip/fallback-encoding/view/head:/debian/unzip-default-charset.sh

It would be nice if unzip had fallback charset mapping per locale out of the box. I have created a test case to handle 3 types of zip files in ja_JP locale.

[2] http://bazaar.launchpad.net/~nobuto/ubuntu/vivid/unzip/fallback-encoding/view/head:/debian/tests/fallback-encoding
(without [1], 3rd test case, fat and CP932, will fail.)

$ unzip -v
UnZip 6.1c19-BETA (2015-04-15) by Info-ZIP. Maintainer: Steven M. Schweda
 Copyright (c) 1990-2015 Info-ZIP. For software license: unzip --license
 See README for details. More info: http://info-zip.org/UnZip.html

Compiled with GCC 4.9.2 for Unix (GNU/Linux x86_64).

UnZip special compilation options:
        ARCHIVE_STDIN (Allow streaming archive from stdin)
        ICONV_MAPPING (ISO/OEM (iconv, -I/-O) conversion supported)
        IZ_HAVE_UXUIDGID (UID, GID > 16-bit ("ux" extra block) supported)
        SET_DIR_ATTRIB (Setting directory attributes supported)
        SYMLINKS (Symbolic links supported, if RTL and file sys do)
        TIMESTAMP (Restoring file timestamps supported)
        UNIXBACKUP (-B creates backup files)
        USE_EF_UT_TIME (Use Universal Time, if available)
        UNSHRINK_SUPPORT (PKZIP/Zip 1.x Shrink compression)
        DEFLATE64_SUPPORT (PKZIP 4.x Deflate64(tm) compression)
        UNICODE_SUPPORT [wide-chars, char coding: UTF-8] (handle UTF-8 paths)
        MBCS-support (Multibyte character support, MB_CUR_MAX = 6)
        LARGE_FILE_SUPPORT (Large files over 2 GiB supported)
        ZIP64_SUPPORT (Archives using Zip64 for large files supported)
        BZIP2_SUPPORT (PKZIP 4.6+, bzip2 lib ver 1.0.6, 6-Sept-2010)
        LZMA_SUPPORT (PKZIP 6.3+, LZMA compression, ver 9.20)
        PPMD_SUPPORT (PKZIP 6.3+, PPMd compression, ver 9.20)
        VMS_TEXT_CONV (Conversion of VMS var-len rec fmt text supported)
        IZ_CRYPT_TRAD (Traditional (weak) encryption, ver 3.0)

Traditional Zip Encryption notice:
        The traditional zip encryption code of this program is not
        copyrighted, and is put in the public domain. It was originally
        written in Europe, and, to the best of our knowledge, can be freely
        distributed in both source and object forms from any country,
        including the USA under License Exception TSU of the U.S. Export
        Administration Regulations (section 740.13(e)) of 6 June 2002.

UnZip and ZipInfo environment options:
           UNZIP: [none]
        UNZIPOPT: [none]
         ZIPINFO: [none]
      ZIPINFOOPT: [none]