Emacs的文件内容比较问题

Vim、Emacs配置和使用
回复
gabriel1017
帖子: 17
注册时间: 2010-10-06 12:44

Emacs的文件内容比较问题

#1

帖子 gabriel1017 » 2010-10-06 12:53

用了emacs一段时间
当我进行两个文件的中文内容比较时发现diff输出的字符编码不正常.
问问各位高人,如何解决?
Q1:使用 emacs+cygwin 比较中文内容的文件时出现输出字符编码问题如何处理?
Q2:若不安装cygwin,可不可以单用emacs实现文件内容比较?(在windows下)
小弟先谢过,等待中......
gabriel1017
帖子: 17
注册时间: 2010-10-06 12:44

Re: Emacs的文件内容比较问题

#2

帖子 gabriel1017 » 2010-10-06 12:57

是啊
我先用emacs输入 M-x ediff 比较两个文件
报出 找不到 diff
然后差了国外的一些网站
安装了 cygwin
ediff 还是不能用 不过 diff 勉强能比较出结果但乱码
然后就不晓得怎么办了
我的是windows平台下
我在想
能不能做到想vim一样的
直接安装了以后就有比较功能
而不用再安装像cygwin这么大的东东
gabriel1017
帖子: 17
注册时间: 2010-10-06 12:44

Re: Emacs的文件内容比较问题

#3

帖子 gabriel1017 » 2010-10-06 19:03

pocoyo 写了:win下想必麻烦 貌似必须是cygwin吧。
有没有可能用其他方法实现文件的对比?
gabriel1017
帖子: 17
注册时间: 2010-10-06 12:44

Re: Emacs的文件内容比较问题

#4

帖子 gabriel1017 » 2010-10-06 19:07

难道没有高手能帮我解答吗?
能帮我解决字符编码的问题吗?
gabriel1017
帖子: 17
注册时间: 2010-10-06 12:44

Re: Emacs的文件内容比较问题

#5

帖子 gabriel1017 » 2010-10-06 21:07

:em20
怎么还没有高手来啊
自己顶!
gabriel1017
帖子: 17
注册时间: 2010-10-06 12:44

Re: Emacs的文件内容比较问题

#6

帖子 gabriel1017 » 2010-10-06 21:43

pocoyo 写了:

代码: 全选

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(current-language-environment "Chinese-GB18030")
 '(tool-bar-mode nil))
win下我的只设了个语言环境。暂时还没遇到啥特别的乱码情况
current-language-environment 能被 cygwin 的返回读到吗?
我的 emacs 用了 unicad 这个插件
打开文件的时候不会出现乱码
但是当我用 ediff 得到差异比较结果的时候
两个被比较的文件如果是中文就会出现乱码
我不知道问题出在了哪个步骤
这个方法能搞定吗?
gabriel1017
帖子: 17
注册时间: 2010-10-06 12:44

Re: Emacs的文件内容比较问题

#7

帖子 gabriel1017 » 2013-02-18 16:38

恩恩 谢谢啦
回复