[Bug 271657] unzip doesn't know infozip (beta)'s -O and -I options

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 26 May 2023 14:30:44 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271657

            Bug ID: 271657
           Summary: unzip doesn't know infozip (beta)'s -O and -I options
           Product: Base System
           Version: Unspecified
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: arthur200126@gmail.com

Info-ZIP's release engineering has stalled, but they have managed to tag a beta
with the unzip-iconv patch integrated.[1]  Unzip 6.10b[2] introduces:
  [1]: https://en.wikipedia.org/wiki/Info-ZIP#Official_betas
  [2]:
https://sourceforge.net/projects/infozip/files/unreleased%20Betas/UnZip%20betas/

  "  \"New\" options -I and -O (from a patch that has been out there awhile)",
  "  are used on UNIX to set the ISO and OEM code pages used for conversions.",
  [...]
  "  -I   [UNIX] ISO code page to use.",
  "  -O   [UNIX] OEM code page to use.",

Now as unheard-of as Info-UnZIP 6.10b is, the two options have actually been in
use for a long time via unzip-iconv and Debian.[3]  Any East Asian person will
probably point you to that fork of info-zip unzip to properly extra a Windows
ZIP file.
  [3]:
https://github.com/emergy/unzip/blob/master/debian/patches/04-unzip60-alt-iconv-utf8

Implementation-wise, libarchive has an encoding conversion function for ZIP
files: just use archive_read_set_options() to set hdrencoding.  There's some
very weird logic to decide whether to use -I or -O depending on the zip's
originating system, but I would just advice you to ignore it.  There's also
some logic to set defaults for these switches, but why even bother.

PS: Unzip 6.10b has a rewritten argument parser with long options. That's very
new and seldom used, so let's not worry about it. It does make reading the code
a lot less torturous -- hats off to that.

-- 
You are receiving this mail because:
You are the assignee for the bug.