Solve Some file garbled characters in Linux

Source: Internet
Author: User
Article Title: solves the problem of some file garbled characters in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

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 named "common linux commands" which can be opened normally in windows, but garbled characters may occur when opened in linux. The solution is to enter the file on the terminal:

Iconv-f gbk-t utf8 common linux commands. Txt> common linux commands. Txt. utf8

Then open "common linux commands. Txt. utf8 "file. The Garbled text above solves the problem.

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.