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)

相关文章:

  • 2022-12-23
  • 2021-06-20
  • 2021-08-25
  • 2021-11-20
  • 2021-11-20
  • 2021-09-28
  • 2021-11-25
猜你喜欢
  • 2021-12-22
  • 2022-12-23
  • 2021-08-24
  • 2021-11-30
  • 2021-10-03
  • 2022-12-23
相关资源
相似解决方案