How to enable garbled txt files in CentOS

Source: Internet
Author: User

How to enable garbled txt files in CentOS

In CentOS, garbled characters are displayed when the edited Chinese characters are displayed in Windows because the encoding used by the two operating systems is different. In Linux, UTF-8 is used, while in Windows, gb18030 is used. Therefore, there are two methods for Linux to enable Chinese garbled characters in txt files.

Method 1:

In the attachment terminal, enter the directory where the txt file is located, use the command "iconv-f gb18030-t utf8 1.txt-o 2.txtcharacter to convert the 1.txtof gb180301_to utf82.txt. This 2.txt is a Linux-supported encoding.

Method 2:

In the attachment terminal, use the command "gconf-editor" to enter the environment configuration, expand "/apps/gedit-2/preferences/encodings /", edit "auto_detected" on the right to add "gb18030" to the top. Later, the text editor will be able to display Chinese characters normally.

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.