Linux decompression unzip Chinese garbled solution

Source: Internet
Author: User


1, in the Linux system backup files, in the Windows decompression appeared in Chinese garbled, this is actually a mistake, I use the win03 with the zip view Explorer directly copied, so there is this problem, we recommend the use of free 7-zip.

2, backup the program zip file on Windows, if the file path contains Chinese, unzip in Linux may appear garbled

Analysis: Files that are compressed on windows are compressed with the system default encoding Chinese. Because the zip file does not declare its encoding, unzip on Linux is generally extracted by default encoding, the Chinese file name will appear garbled.

In 2005, it was reported as a bug, but Info-zip's official website did not include the automatic identification code in the plan, perhaps they did not think it was a problem. Sun's n-year zip coding problem exists in Java, using the same approach.

Then this problem can only be handled by ourselves, the method is actually very simple, the following three ways to solve:

(1). Extract by Unzip line command, specify character set
Unzip-o CP936 Xxx.zip (with GBK, GB18030 can also)
Interestingly, there is no explanation for this option in Unzip's manual, and Unzip–help has a simple one-line explanation for this parameter.

(2). In the environment variable, specify the unzip parameter, always display and decompress the file in the specified character set
Add 2 rows to the/etc/environment
unzip= "-O Cp936″
zipinfo= "-O Cp936″

(3) Unpack the ZIP package jar using the Java Jar command

Jar XVF File.name

Reprinted from: http://303i.com/article/2012/12/03/574.html

Linux decompression unzip Chinese garbled solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.