zip 解压乱码:代码页 cp936

Windows 使用的简体中文编码与 UTF-8 不兼容会导致乱码。[1]

使用 -O cp936 选项[2] [3] [4] [5] [6]

1
$ unzip -O cp936 <zip file>

也可以给 -O 选项使用参数:

  • GBK
  • GB2312
  • GB18030

备选项 [6:1]

安装 7zip 和 convmv 工具:

1
sudo apt-get install p7zip-full convmv
1
2
3
4
5
LANG=C
7z x -o{Directory} <zip file>
convmv -f gbk -t utf8 --notest -r <output dir>
# 或者先 cd 到输出文件夹
convmv -f gbk -t utf8 --notest ./*

  1. (2003) (英文)#197427 - unzip: chinese filenames unwrapped on unix wrongly ↩︎

  2. (2014) Linux 下 zip 文件解压乱码如何解决? ↩︎

  3. (2020) Ubuntu压缩及解压文件简介 ↩︎

  4. (2019) 【技巧】linux环境下,用unzip解压zip文件时,若解压文件中存在中文,会出现中文乱码问题 ↩︎

  5. (2021) linux下解压zip乱码问题的解决(unzip) ↩︎

  6. (2016) Linux文件乱码 ↩︎ ↩︎