In ubuntu12.04, how does one solve gedit's problem of opening Chinese TXT files with garbled characters?

Source: Internet
Author: User

Source: http://forum.ubuntu.org.cn/viewtopic.php? F = 48 & amp; T = 380247

Problem description:

In ubuntu 12.04, enter win7's scripts and open the. txt file with gedit. Chinese characters are not displayed normally and are garbled.

 

Cause:

On the UBUNTU Forum's Chinese wiki, find the reason:

"By default, garbled characters will appear when you use the Ubuntu Text Editor (gedit) to open Chinese-encoded text files of the gb18030, GBK, and gb2312 types.

This is because gedit uses an encoding matching list. Only the encoding in this list is matched. Encoding not in this list is garbled. All you need to do is add gb18030 to this matching list ."

 

Solution:

Enter the following two commands in the terminal:

Gsettings
Set org. gnome. gedit. preferences. encodings auto-detected "['gb18030 ',
'Gb2312', 'gbk', 'utf-8', 'big5', 'stream', 'utf-16'] "gsettings
Set org. gnome. gedit. preferences. encodings shown-in-menu "['gb18030 ',
'Gb2312', 'gbk', 'utf-8', 'big5', 'stream', 'utf-16']"

 

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.