unzip 没有-O 选项?

2016-04-07 10:28:48 +08:00
 klesh
mac 的 unzip 不能指定页码,解压文件乱码,如何破?
6454 次点击
所在节点    macOS
15 条回复
BOYPT
2016-04-07 10:41:13 +08:00
需要安装 unzip-iconv
napsterwu
2016-04-08 13:06:34 +08:00
7z
xjbeta
2016-04-09 08:28:15 +08:00
unzip --help 不就是了
dvorak4tzx
2016-04-09 14:51:59 +08:00
这好像是个常见的无解的 bug :[File Roller/Unzip 解压中文 Zip 文件名乱码]( https://linuxtoy.org/archives/wrong-handling-of-chinese-coded-filename-in-fileroller-unzip.html)
klesh
2016-04-09 15:34:53 +08:00
@BOYPT homebrew 没有这条 formula 。搜了一圈没找到什么有用的信息
klesh
2016-04-09 15:37:19 +08:00
@napsterwu 装了 p7zip , man 了一把貌似还是没有找到指定编码的选项,默认解出来是乱码。
@xjbeta --help 会有比 man 多出来信息吗?回头试试
@dvorak4tzx zip 是这样的,只是奇怪 mac 下面的 unzip 没有像 linux 那样提供 -O 选项可以指定页码。
最后装了个 The Unarchiver , mac store 里免费的软件,可以正确识别 win 下打包的 cp936 zip 文件 。
xjbeta
2016-04-09 15:42:33 +08:00
@klesh 只有-o (overwrite files without prompting) 并没有-O
BOYPT
2016-04-09 21:06:06 +08:00
@klesh unzip-iconv 是一个一直没有被 unzip 官方接纳的补丁。
hrong
2016-04-10 20:56:13 +08:00
好吧,虽然这个是在 MACOS 论坛下,但是我的解决方案是 https://dotnetzip.codeplex.com 亲测可用的。
klesh
2016-04-10 21:17:29 +08:00
@hrong 我需要的是工具,不是库。即使是自己写用 .net 也不科学呀。不过还是谢谢你 :)
Tony8Finet
2016-04-11 04:03:56 +08:00
找 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
2016-04-11 11:24:15 +08:00
我这两天也遇到这个问题, debian 7 上 unzip 版本没有- O 选项,后来我用了 unar 搞定:
sudo apt-get install unar
unar -e GBK xxx.zip
klesh
2016-04-11 23:07:20 +08:00
@flybluewolf 这个有用。

@Tony8Finet 谢谢
FindHao
2016-04-14 14:36:59 +08:00
http://www.findspace.name/easycoding/1605
主要也看到了 4 楼的连接。
现在的方法主要是 unar 和给 unzip 打补丁了。
uxstone
2019-06-17 21:33:00 +08:00
我是从 2019 年穿越过来的
unzip 的这个问题还存在。。。。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/269161

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX