Solution to garbled Chinese characters in the Ubuntu text editor gedit
Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
By default, garbled characters are displayed when you use the Ubuntu text editor (gedit) to open Chinese-encoded text files of the GB18030, GBK, and GB2312 types. The reason for this is that gedit uses a list of encoding matches only the encoding in this list ,... by default, garbled characters are displayed 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 the matching list.
Command line method, applicable to all Ubuntu users.
Copy the following command to the terminal and press enter:
Gconftool-2 -- set -- type = list -- list-type = string/apps/gedit-2/preferences/encodings/auto_detected "[UTF-8, CURRENT, GB18030, BIG5-HKSCS, UTF-16]"
Graphical mode, applicable to Ubuntu users, not KUbuntu/XUbuntu users.
Follow these steps to make your gedit correctly display the Chinese encoding file.
1. press Alt-F2 to open the run Application dialog box.
2. type "gconf-editor" in the text box and press the Enter key to open "configuration editor ".
3. expand the tree node on the left, find the/apps/gedit-2/preferences/encodings node, and click it.
4. double-click the auto_detected key on the right to open the "Edit key" dialog box.
5. click "add" on the right of the list, enter "GB18030", and click "OK.
6. a "GB18030" is added at the bottom of the list ". Click select it, and click the "up" button on the right until "GB18030" is at the top of the list.
7. Click OK to close the configuration editor.
Now, your gedit should be able to smoothly open the GB18030 encoded text file.
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to firstname.lastname@example.org. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
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:
and provide relevant evidence. A staff member will contact you within 5 working days.