Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要读取一个 C++ 头文件,其中包含一些中文并使用 utf-8 编码。
Emacs 应该能识别这种编码,但事实证明:
然后,我将其更改为文本模式,它可以工作:
我还测试了 python-mode、lisp-mode 等,除了 c-mode、c++-mode、java-mode 之外的所有工作,似乎 cc-mode 或 cc-vars 有问题?
如果您知道如何解决这个奇怪的问题,请帮助我。
这看起来更像是缺少字体(而不是编码)问题;即,您的系统缺少正确配置的中文斜体字体。
实际上,它可以说是 Emacs 中的一个错误:它应该回退到其他字体(如果需要,非斜体)而不是显示空白方块。多年来,我们已经修复了一些此类问题,因此请尝试最新的 Emacs-24 预测试,看看该错误是否已经修复,否则M-x report-emacs-bug
M-x report-emacs-bug