Linux ubuntu12.04 unzip the Chinese ZIP file and garbled characters

Source: Internet
Author: User

The compressed zip package in Windows is garbled after being decompressed In ubuntu.


1.zip file unzippered with garbled characters:

Step 1 first install 7zip and convmv (if not installed before)

Run the following command on the command line:

Sudo apt-Get install p7zip-full convmv


Step 2. Set the ZIP file name to y05document. Zip. First, enter the directory where the ZIP file is located, and then run the command line

Lang = C 7z x y05document. Zip

Convmv-F cp936-T utf8-r -- notest *


2. garbled File Content

For Files compressed by Windows rar, unzip the files in Linux and open the files. The contents are garbled.


Garbled characters occur because some files in the compressed files are named in Chinese. In Windows, the Chinese encoding is generally GBK, while in Linux, the Chinese encoding is generally utf8, so the files normally opened in Windows may be garbled in Linux.

Solution: Use the iconv command to convert the file content encoding.

For example, I have a file "y05文.txt .txt" which can be opened normally in windows, but it will be garbled in Linux. The solution is to enter the file on the terminal:

Iconv-f gbk-T utf8 y05文.txt .txt>
Y05文.txt .txt. utf8

Then open the "y05文.txt .txt. utf8" file, and solve the Garbled text.



Decompress the garbled characters of the rarfile packaged in the win environment (because of the encoding, Chinese files packaged in windows are garbled during decompression, and the error message is invalid encoding format, because windows is the GBK encoding format, and Ubuntu uses the utf8 encoding format by default, this file can be solved using the convmv command ):

After the system is reinstalled, run the RAR installation command: sudo apt-Get install rar,

To decompress the rarfile in Linux, run the following command: RAR e a.rar,

In this case, decompress the rarfile packaged in the win environment and garbled characters.

Run the following command: sudo apt-Get install convmv (install convmv ),

Run convmv *-f gbk-T utf8.
-- Notest (* is the file to be converted, and -- notest is to rename the file)


Open the. txt file in Ubuntu and the Chinese text is garbled

Open the application-System Tools-configuration editor. If not, Open System -- preferences -- main menu -- System Tools -- configuration editor. Open the apps-> gedit-2-> preferences-> encodings history file in sequence, and the problem is solved.

There should be better solutions. At present, I only find this suitable computer environment for me.

Hope to enlighten me.

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.