Solve Linux below (Ubnutu) gedit Open Text Chinese garbled __linux

Source: Internet
Author: User

The problem was solved a long time ago, but in the near future, so as not to forget later, here to record.

First of all, if the installation of the Ubnutu is in English version, do not know the Chinese version will not appear garbled problems.

Gedit This tool, embedded in Linux, and Linux is a foreign master to get out of things, all know that pull, others are used by the ABC, and we are using the curved text. In fact, in the whole computer field, the general is ABC, who call the computer is foreign people out of it. Okay, don't pull it off, solve the problem.

1, the reason is garbled, it is encoded in different character sets, the international common character set code is mainly UTF-8, and the Chinese character encoding happens by default is not Utf-8,win under the Chinese editor, Character set defaults are also not UTF8. And, when you save, a lot of people don't pay attention to character set problems, so to solve this problem, we still have to adapt our own text editor to other character sets. Gedit uses an encoding matching list, only the encoding in this list will be matched, and the encoding not in this list will be displayed as garbled. So all you have to do is add the matching list to the coded character set that you want to use.

2, in Ubuntu11. Before X, the commands used vary, because the gedit version used is different. So in Ubnutu11 and before, most of the uses are gedit2.x, then use the following command:

Gconftool-2--set--type=list--list-type=string/apps/gedit-2/preferences/encodings/auto_detected "[GB18030,UTF-8, CURRENT,ISO-8859-15,UTF-16] "What we're going to do is put the character set we're setting in [gb18030,utf-8,current,iso-8859-15,utf-16], like I add a GB2312, Then it becomes "[gb2312,gb18030,utf-8,current,iso-8859-15,utf-16]", the whole order is gconftool-2--set--type=list--list-type=  String/apps/gedit-2/preferences/encodings/auto_detected "[gb2312,gb18030,utf-8,current,iso-8859-15,utf-16]".

After the UBNUTU11, the use of the Gedit has also been upgraded, gedit3.x, changed the command, it can, in fact, simplified the order of the specific orders are as follows:


gsettings Set org.gnome.gedit.preferences.encodings auto-detected "[' GB18030 ', ' GB2312 ', ' GBK ', ' UTF-8 ', ' BIG5 ', '"] Current ', ' UTF-16 ']
gsettings Set org.gnome.gedit.preferences.encodings shown-in-menu "[' GB18030 ', ' GB2312 ', ' GBK ', ' UTF-8 ', ' BIG5 ', '"] Current ', ' UTF-16 ']
After setting up, gedit Chinese garbled problem, under normal circumstances will be 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.