Ubuntu unpack (unzip) garbled solution

On Windows compressed files, based on the Windows system default encoding Chinese to compress files. Because of the zip file does not declare its encoding, so unzip the default encoding linux generally decompression, Chinese file name garbled.

By unzip --helpaccess to help files, we found a document Tip You can use the -O to specify the character set to decompress, as shown below

Thus obtained two ways to solve the garbage problem:

  • By extracting unzip command line, specify the character set.
unzip -O CP936 xxx.zip (用GBK, GB18030也可以)
  • In an environment variable, specify the parameters unzip, and always show-extracting file to specify the character set, / etc / environment added 2 lines
UNZIP="-O CP936"
ZIPINFO="-O CP936"

Reference Links: https://forum.ubuntu.org.cn/viewtopic.php?f=122&t=175405&p=1343326

Guess you like

Origin www.cnblogs.com/Flylater/p/11079544.html