• Ubuntu gedit 中文乱码解决方法


    有些在Windows下能够打开的txt文件在Ubuntu下用gedit打开时,中文显示是乱码,这是因为编码方式不同造成的。Windows下默认txt文件的编码方式是GBK,而Ubuntu下的gedit默认没有对GBK的支持。解决方法如下:

    在终端运行gconf-editor,(如果没有安装用“sudo apt-get install dconf-tools”安装。

    在apps -> gedit-2 -> preference -> encodings里面有个auto-detect,在它的前面加上GBK或GB18030就OK了。

    PS:使用的时候,我的preference的目录下面就是没有encodings的选项,因此改用一下方案:

    打开终端输入:
    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']"

     此时,重新打开gedit文件,没有中文乱码。


  • 相关阅读:
    对学生排序 Exercise07_17
    消除重复 Exercise07_15
    计算gcd Exercise07_14
    随机数选择器 Exercise07_13
    dom4j 学习总结
    jQuery学习总结(二)
    jQuery学习总结(一)
    SQL中Where与Having的区别
    html + css (1)
    struts2+json
  • 原文地址:https://www.cnblogs.com/duboway/p/3029532.html
Copyright © 2020-2023  润新知