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, and only the encoding in this list will match... 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'].
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.