Emacs改变字符编码
打开文件出现乱码时,可以尝试修改字符的编码:M-x revert-buffer-with-coding-system
RET(回车)
然后输入对应编码,如:utf-8 或者 chinese-gbk。
在保存的时候还可以指定文件的保存编码:M-x set-buffer-file-coding-system
如果想设定默认编码,可以在配置文件中输入: (set-language-environment "UTF-8")
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-clipboard-coding-system 'utf-8)
(set-buffer-file-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(modify-coding-system-alist 'process "*" 'utf-8)