In Ubuntu under the decompression of Windows compressed ZIP file, will appear extracted with Chinese file name garbled, this is because Ubuntu and Windows default encoding is different, Ubuntu under the default encoding is UTF-8, The default encoding under Windows is GBK. There are three ways to solve this problem:
One, the command line specifies the decompression character set
In Ubuntu to extract the zip file from windows, the Chinese file name will appear garbled problem.
This problem occurs because the default encoding used by Windows and Ubuntu is not the same, and the zip file itself does not have any information that identifies its encoding.
The solution is: Specify the character set when extracting, can be, cp936,gbk,gb18030
$unzip-O CP936 xxx.zip
However, "man unzip" does not have any explanation for this parameter, but "unzip--help" has a simple one-line explanation for this parameter.
Some people on the internet say that this method does not always work, on Ubuntu 12.04, it is possible.
Ii. Specify unzip display and decompression parameters in the environment variable
Add the following two lines to the/etc/environment:
unzip= "-O CP936"
zipinfo= "-O CP936"
In this way, the GNOME Desktop Archive Manager (File-roller) can use unzip to extract Chinese.
Third, use P7zip decompression 1.Installing P7zip-full
$sudo Apt-get Install P7zip-full
2. Uninstalling unzip
$sudo Apt-get Remove Unzip
3. Download the updated P7zip-full package to replace the original program/usr/lib/p7zip/
P7z-bin.tar.gz:p7z-bin.tar.gz (limited to i386 version)
$sudo tar xzvf p7z-bin.tar.gz-c/usr/lib/p7zip
4. Use the lock P7zip, P7zip-rar, and p7zip-full versions (to prevent invalidation after the update)
1) Install the new Rieter Software manager sudo apt-get install synaptic (if it has been installed can skip)
2) Open the new Rieter Package Manager and search for P7zip
3) in the results of the search, select P7zip, P7zip-rar, and P7zip-full, then click on the package-----set--lock version
Iv. Conclusion
1, the recommended way to solve the zip file to extract the Chinese file name garbled problem.
2. Method one using the command line with parameters is not very convenient.
3, method Three need to uninstall unzip, and many software is dependent on unzip, uninstall unzip at the same time, these rely on unzip software will also be uninstalled.
The above method was tested under Ubuntu 12.04.
=-=-=-=-=
Powered by Blogilo
Ubuntu solve the problem of extracting zip files in Chinese file name garbled