klesh
V2EX  ›  macOS

unzip 没有-O 选项?

  •  
  •   klesh · Apr 7, 2016 · 7739 views
    This topic created in 3870 days ago, the information mentioned may be changed or developed.
    mac 的 unzip 不能指定页码,解压文件乱码,如何破?
    15 replies  •  2019-06-17 21:33:00 +08:00
    BOYPT
    BOYPT
    Apr 7, 2016
    1
    需要安装 unzip-iconv
    orcusfox
    orcusfox
    Apr 8, 2016
    2
    7z
    xjbeta
    xjbeta
    Apr 9, 2016 via iPhone
    3
    unzip --help 不就是了
    dvorak4tzx
    dvorak4tzx
    Apr 9, 2016
    4
    这好像是个常见的无解的 bug :[File Roller/Unzip 解压中文 Zip 文件名乱码]( https://linuxtoy.org/archives/wrong-handling-of-chinese-coded-filename-in-fileroller-unzip.html)
    klesh
    klesh
    OP
    Apr 9, 2016
    5
    @BOYPT homebrew 没有这条 formula 。搜了一圈没找到什么有用的信息
    klesh
    klesh
    OP
    Apr 9, 2016
    6
    @napsterwu 装了 p7zip , man 了一把貌似还是没有找到指定编码的选项,默认解出来是乱码。
    @xjbeta --help 会有比 man 多出来信息吗?回头试试
    @dvorak4tzx zip 是这样的,只是奇怪 mac 下面的 unzip 没有像 linux 那样提供 -O 选项可以指定页码。
    最后装了个 The Unarchiver , mac store 里免费的软件,可以正确识别 win 下打包的 cp936 zip 文件 。
    xjbeta
    xjbeta
    Apr 9, 2016
    7
    @klesh 只有-o (overwrite files without prompting) 并没有-O
    BOYPT
    BOYPT
    Apr 9, 2016
    8
    @klesh unzip-iconv 是一个一直没有被 unzip 官方接纳的补丁。
    hrong
    hrong
    Apr 10, 2016
    9
    好吧,虽然这个是在 MACOS 论坛下,但是我的解决方案是 https://dotnetzip.codeplex.com 亲测可用的。
    klesh
    klesh
    OP
    Apr 10, 2016
    10
    @hrong 我需要的是工具,不是库。即使是自己写用 .net 也不科学呀。不过还是谢谢你 :)
    Tony8Finet
    Tony8Finet
    Apr 11, 2016
    11
    找 unzip610b.zip, 自己编译:

    CHANGES AND NEW FEATURES
    ------------------------
    UnZip 6.10b currently adds the following features:

    - Implement Windows full Unicode support.
    - Add -I and -O options for setting ISO and OEM character sets,
    respectively, used by UnZip when doing character set translations.
    - Various cleanup of VMS and Unicode code.
    - Better handling of the PKWare verification bit.
    - Implement Acorn port changes based on patch provided by J.L. that
    updates the port to use current compilers, increases allowed file path
    lengths to 1024 characters, adds directory attributes support, and updates
    documentation.
    flybluewolf
    flybluewolf
    Apr 11, 2016❤️1
    12
    我这两天也遇到这个问题, debian 7 上 unzip 版本没有- O 选项,后来我用了 unar 搞定:
    sudo apt-get install unar
    unar -e GBK xxx.zip
    klesh
    klesh
    OP
    Apr 11, 2016
    13
    @flybluewolf 这个有用。

    @Tony8Finet 谢谢
    FindHao
    FindHao
    Apr 14, 2016
    14
    http://www.findspace.name/easycoding/1605
    主要也看到了 4 楼的连接。
    现在的方法主要是 unar 和给 unzip 打补丁了。
    uxstone
    uxstone
    Jun 17, 2019
    15
    我是从 2019 年穿越过来的
    unzip 的这个问题还存在。。。。。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   922 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 21:56 · PVG 05:56 · LAX 13:56 · JFK 16:56
    ♥ Do have faith in what you're doing.