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.