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.
1. Command Line
Starting from ubuntu11.10, the default gsettings (based on command line) is used as the System Configuration tool. To solve text garbled characters in gedit, you only need to execute the following command on the terminal:
Gsettings set Org. gnome. gedit. preferences. encodings auto-detected "['utf-8', 'gb18030', 'gb2312', 'gbk', 'big5', 'current', 'utf-16']"
2. Image Methods
Enter
Sudo apt-Get install dconf-tools -- install dconf-Editor
Press Alt-F2, open the run application dialog box, enter dconf-Editor + press enter, open dconf-Editor
Go to org ---> gnome ---> gedit ---> preferences ---> encodings ---> auto-Detected
Add at the beginning
'Gb18030', 'gb2312', 'gbk'. after entering the value, press enter to save the entered content.
The result is ['utf-8', 'gb18030', 'gb2312', 'gbk', 'big5', 'current', 'utf-16'].