Http://blog.csdn.net/samantha_sun/article/details/6347645
1. Enable the Ubuntu system to support Chinese:
Sudo locale-gen zh_cn.gb18030
Man has several manual pages.
There are some articles on the Internet that we should first edit/var/lib/locales/supported. d/local
Add a row: zh_cn.gb18030 gb18030
Then execute locale-gen
This seems unnecessary ...... After "sudo locale-gen zh_cn.gb18030" is executed, the program automatically adds necessary content under/var/lib/locales/supported. d/local.
2. Ubuntu supports GBK encoding. Set eclipse below.
Open eclipse and choose Edit> set encoding from the menu. then select other gb18030. If you do not have the gb18030 option, it doesn't matter. Enter several gb18030 characters directly. Apply and gb18030 are encoded in Chinese, which is no longer garbled.
Http://wiki.ubuntu.org.cn/Gedit%E4%B8%AD%E6%96%87%E4%B9%B1%E7%A0%81
3. Solve the Chinese garbled characters in gedit:
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.
- Press the Alt-F2 to open the run application dialog box.
- In the text box, type "gconf-Editor" and press the Enter key to open "configuration Editor ".
- Expand the tree node on the left, find the/apps/gedit-2/preferences/encodings node, and click it.
- Double-click the auto_detected key on the right to open the edit key dialog box.
- Click Add on the right of the list, enter gb18030, and click OK.
- 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.
- Click OK to close the configuration editor.
Now, your gedit should be able to smoothly open the gb18030 encoded text file.