Linux ubuntu12.04 unzip the Chinese zip file, after decompression garbled

Source: Internet
Author: User

Compressed Zip package under Windows, after decompression in Ubuntu display as garbled problem files after decompression file name garbled:

The first step is to install 7zip and CONVMV first (if not previously installed)
Execute the installation command at the command line as follows:
sudo apt-get install p7zip-full CONVMV

The second step assumes that the zip file is named Y05 document. zip, then enter the directory where the zip file is located, then the command line executes
Lang=c 7z x y05 document. zip
Convmv-f cp936-t utf8-r--notest *

2. garbled file contents

The original Windows RAR compressed files, the Linux system after decompression open the inside of the file, the contents are garbled.

Garbled is because of the compressed files, some of the files are named in Chinese. While in the Windows Chinese encoding is generally GBK, and Linux under the Chinese encoding is generally utf8, so under Windows normally open files, to Linux is likely to appear garbled.

The workaround is to convert the file content encoding using the command iconv.

For example I have a file "y05 document. txt" Open normally under Windows, while open in Linux will be garbled, its solution for the terminal input:

Iconv-f gbk-t UTF8 y05 document. txt > y05 document. Txt.utf8

Then open the "y05 document. Txt.utf8" This file, the text see the garbled problem solved.

Unzip the win environment packaging RAR file garbled ( due to the encoding, in Windows packaging of the Chinese file, after extracting garbled, prompt for invalid encoding format, because Windows is GBK encoding format, and Ubuntu under the default use of the true UTF8 encoding format, this file can be used CONVMV this command to resolve):

After reloading the system, execute the command rar installation command: sudo apt-get install RAR,

Unzip the RAR file in Linux, usually using the command: RAR e A.rar,

After this, unzip the win environment package RAR file, after decompression is garbled.

At this point the command line executes:sudo apt-get install convmv (Installation convmv),

Then execute: CONVMV *-F gbk-t UTF8--notest (* is the file to be converted,--notest is to rename the file )

Open under Ubuntu. TXT file, Chinese display as garbled

Open the application-system Tools-Configuration Editor. If not, open the system-preferences-main Menu-System Tools-Configuration Editor. Tap auto-detected in apps->gedit-2->preferences->encodings to add gb18030,gbk,gb2312 in the double-click Pop-Up dialog box, and then GB18030, GB2312 move to the most open. txt file again, the problem is resolved.
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: 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.