Solve the garbled problem of Ubuntu uncompressed Windows generated zip files by __ garbled problem

Source: Internet
Author: User

Reference URL: http://forum.ubuntu.org.cn/viewtopic.php?t=175405


Files that are compressed on windows are compressed by the system's default encoding Chinese. Because the zip file does not declare its code, so Linux unzip generally with the default encoding decompression, Chinese file name will appear garbled.
Although it was reported as a bug in 2005, Info-zip's official website did not include the automatic Identification code, which may not be considered a problem. Sun has the same approach to the problem of N-year zip coding in Java.

There are 2 different ways to solve the problem:

1. Through the Unzip line command decompression, the specified character set
Unzip-o CP936 Xxx.zip (with GBK, GB18030 can also)
Interestingly, there is no explanation for this option in Unzip's manual, unzip--help a simple one-line description of this parameter.

2. In the environment variable, specify the unzip parameter, always display the decompression file in the specified character set
Add 2 lines to the/etc/environment
unzip= "-O CP936"
zipinfo= "-O CP936"

The GNOME Desktop Archive Manager (File-roller) can use unzip to extract Chinese correctly, but File-roller itself does not set the encoding to be passed to unzip.



I tried the first method to extract it successfully.

Related Article

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.