2014年8月22日

Linux Meld 比较工具,升级后怎么设置字符编码

Meld 升级到 3.11 版本后,原来设置语言文字编码的选项消失了。
没有了编码检测设置,在比较文件时常会遇到 "无法提取文件 文件不是使用 ['utf8'] 进行编码的" 或者 "Could not read file, file is not in encodings: ['utf8']"。
参考这里:Meld 3.11.0 and encoding
in meld 1.8.4 I had the option "Encoding". Here I used "utf8 latin1".
In meld 3.11.0 there is no "Encoding" options. It seems to use only utf8.
By comparing some of my files I get the error message:"Could not read file"
--------------------
There is no UI for it. You can set the encodings that will be tried in
Meld's 'detect-encodings' gsettings key.
按网上的回答就是:界面设置编码的地方没有了,配置里面仍然有效。

解决办法:
1、 用命令查看当前设置的编码
      gsettings  get  org.gnome.meld  detect-encodings
2、 用命令设置支持哪些字符集编码检测
      gsettings  set  org.gnome.meld  detect-encodings  "['utf8','cp936','latin1']"