Ubuntu unzip windows generated zip file garbled problem

Source: Internet
Author: User

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.

There are two ways to solve the problem: (Method one recommended)

1. Extract by Unzip line command, specify the character set: (with GBK, GB18030 can also)

Unzip-o CP936 Xxx.zip
Interestingly, there is no description of this option in Unzip's manual,
Unzip--help has a simple one-line explanation for this parameter, as follows:
-o CHARSET Specify a character encoding for DOS, Windows and OS/2 archives


2. Add the following two lines to the environment variable/etc/environment specify that the unzip parameter always displays and decompress the file in the specified character set:
unzip= "-O CP936"
zipinfo= "-O CP936"
 
In this way, the GNOME Desktop Archive Manager (File-roller) can use unzip to decompress the Chinese, but File-roller itself cannot set the encoding to pass to unzip.

Ubuntu unzip windows generated zip file garbled problem

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.