emacs 编码转换
emacs下打开phpcms的一个代码文件出现了乱码,在gvim下可以正常显示,转换文件编码为
utf-8以后,emacs也可以正常显示,但是使用C-X ret f utf-8却不行,解决办法直接找gnu的文档:
-
C-x <RET> f coding <RET> -
Use coding system coding to save or revisit the file in the current buffer (set-buffer-file-coding-system
). -
C-x <RET> c coding <RET> -
Specify coding system coding for the immediately following command (universal-coding-system-argument
). -
C-x <RET> r coding <RET> -
Revisit the current file using the coding system coding (revert-buffer-with-coding-system
). -
M-x recode-region <RET> right <RET> wrong <RET> -
Convert a region that was decoded using coding system wrong, decoding it using coding system right instead. -
因为访问文件的时候已经是乱码无论怎么转换都不行,只能使用其他编码个是再次访问这个文件才能看到正常编码,就这么简单,但是为什么emacs没有正常的识别编码,我也就不清楚了