Mac下一样平常brew install unrar和brew install unar就可以了。
Mac os的压缩zip文件在windows系统下打开中文文件名乱码实际问题便是文件编码的问题 mac 下默认是UTF-8 而已,windows下默认是GBKWindows下天生的zip文件中的编码是GBK/GB2312等unarunrar x bms-3k.rar /tmp直接解压缩到/tmp目录unar test.zip -o /tmpunar -encoding GBK 项目管理制度.zip------------------------------------------------------unar -encoding list|grep GBK GBK: Chinese (GBK)指定编码解压# unar -encoding GBK 1531461061538.zip1531461061538.zip: Zip 1531461061538.pem (3670 B)... OK. 1531461061538.key (1678 B)... OK.Successfully extracted to "1531461061538".列出压缩包内容:# lsar 1531461061538.zip1531461061538.zip: Zip1531461061538.pem1531461061538.key安装unrarbrew install unrar安装unar命令顺带lsar也就安装了 brew install unarUpdating Homebrew...==> Auto-updated Homebrew!Updated 1 tap (homebrew/core).==> New Formulaeladspa-sdk prometheus-cpp==> Updated FormulaeUpdated 80 formulae.==> Downloading https://homebrew.bintray.com/bottles/unar-1.10.1.catalina.bottle.2.==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/366fc5e1d3587148e089214a######################################################################## 100.0%==> Pouring unar-1.10.1.catalina.bottle.2.tar.gz==> CaveatsBash completion has been installed to: /usr/local/etc/bash_completion.d==> Summary /usr/local/Cellar/unar/1.10.1: 79 files, 13.6MBunar -encoding GBK zhb.zipzhb.zip: Zip 中文名z/ (dir)... OK. 中文名z/zhb_nginx 正式测试代理 .xlsx (19055 B)... OK. 中文名z/zhb_正式测试 tomcat运用做事2.xlsx (18173 B)... OK. 中文名z/ZHB做事器 .xlsx (33792 B)... OK.Successfully extracted to "./中文名z".lsar test.zip列出压缩包内容lsar test.zip###若创造乱码,可指定压缩包文件名利用的编码格式##lsar -e GB18030 test.zip###若能正常列出文件名,可解压###unar -e GB18030 test.zip
