想问一下 Windows 系统中,buffer 输出中的 utf-8、gbk 转换问题

目的是使用 shell-command 调用外部 python 程序,往新建的临时 buffer 中输入文字内容。
python 程序为

print("这是中文 : 中文")
print("이거 한국 글 : 가게")

emac 中的调用执行代码为

(setq exec (concat "python ~/test.py"))
(let ((buf (get-buffer-create "TTTTTTT")))
  (with-current-buffer buff
	(erase-buffer)
	)
  (shell-command exec buf))
(pop-to-buffer buf))
))

在 linux 中正常输出,无错误


而在 Windows 中,遇到非 中文、非英文,比如韩文,就会出错


请问,在 Windows 环境中,emacs 有没有比较好的处理 encode、decode 的方法?



linux 系统: Arch , emacs 版本 30.0.50
Windows 系统: Win7 SP1 64, emacs 版本 27.2

python 加 -X utf8 激活 utf-8 模式

1 个赞

非常感谢! :pray:实测有效! :+1: