Linux ubuntu12.04 decompress the Chinese zip file, uncompress it, and fix it with garbled characters

Source: Internet
Author: User
Tags uncompress

Linux ubuntu12.04 decompress the Chinese zip file, decompress it, and garbled code to solve my computer environment: linux ubuntu12.04 has tried many methods, but the following one is OK on my computer. 1.zip file unzipping file name garbled: first install 7zip and convmv (if not installed before) in the command line to execute the installation command: sudo apt-get install p7zip-full convmv Step 2 false zipfile name y05document .zip, go to the directory where the zip file is located, and then run the command line to execute LANG = C 7z x y05document .zip convmv-f cp936-t utf8-r -- notest * 2. the file content is garbled by the original Windows rar compressed file. in Linux, decompress the file and open the file. The content is 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 y05document .txt> y05document .txt. after utf8, open "y05文.txt .txt. utf8 "file, the garbled problem described in this article is solved. 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 a gbk encoding format, and ubuntu uses the utf8 encoding format by default, this file can be solved using the convmv command): After reinstalling the system, run the following command to install rar: sudo apt-get install rar: Decompress the rarfile in linux. The common command is rar e a.rar. After that, decompress the rarfile packaged in the win environment and decompress it with garbled characters. Run the command line: sudo apt-get install convmv (install convmv), and then run: convmv *-f gbk-t utf8 -- notest (* is the file to be converted, -- notest is to rename the file) Open It In ubuntu. TXT file, Chinese characters are displayed as garbled characters to open the application-System Tools-configuration editor. If not, Open System -- preferences -- main menu -- System Tools -- configuration editor. Open apps-> gedit-2-> preferences-> encodings auto-detected in the double-click pop-up dialog box to add GB18030, GBK, GB2312, then GB18030, GB2312 to the top and then open the TXT file, the problem is solved.

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.