ubuntu14.04 gedit显示GB2312中文编码

在中文支持配置还不完整的Ubuntu 14.04中,使用gedit打开带有中文字符的文件有时会出现乱码的情况,这是由于gedit对字符编码匹配不正确导致的,解决方法如下:

    在终端中输入如下命令,然后重新打开gedit即可:


    gsettings set org.gnome.gedit.preferences.encodings auto-detected "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"

    gsettings set org.gnome.gedit.preferences.encodings shown-in-menu "['GB18030', 'GB2312', 'GBK', 'UTF-8', 'BIG5', 'CURRENT', 'UTF-16']"


注意:

1.不要使用sudo命令设置


 

posted @ 2015-12-09 14:05  fedorayang  阅读(486)  评论(0编辑  收藏  举报