某些Windows下的压缩包由于文件编码的问题复制到Linux下会乱码
解决方案:
1. 使用 unarchiver(推荐)
pacman -S unarchiver # ArchLinux 安装 unarchiver
unar xxx.zip
unar xxx.7z
unar 会自动猜测文件的编码
2. zip 压缩包手动指定文件编码
例如:
unzip -O gbk xxx.zip
注:新版 unzip 已经合并了unzip-iconv patch
如果想要zsh补全,需要修改 /usr/share/zsh/functions/Completion/Unix/_zip 文件,加上-I和-O两个选项,具体修改不赘述,可参考 https://github.com/zsh-users/zsh-completions/blob/master/zsh-completions-howto.org 与 https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Completion-System
'-O[CHARSET specify a character encoding for DOS, Windows and OS/2 archives]:encoding:(CP936 GBK GB2312 GB18030 BIG5)' \
'-I[CHARSET specify a character encoding for UNIX and other archives]:encoding:(CP936 GBK GB2312 GB18030 BIG5)' \

241




被折叠的 条评论
为什么被折叠?



