本文介绍了如何查看emacs中文件的编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到当前文件的编码,如何显示?

I don't find the encoding of current file, how to display it?

您可以看到文件中有一些中文字符,但我不知道它的编码是什么。

You can see there are some Chinese characters in the file, but I don't know what the encoding it is.

有没有办法让它始终在emacs GUI上显示?

Is there any way to let it always show on the emacs GUI?

推荐答案

您可以在模式行中用 U 看到缓冲区是Unicode格式的,如果将鼠标放在其上,它将显示为工具提示当前缓冲区编码

You can see with the U in the mode-line that your buffer is in Unicode, if you put the mouse over it it will show in a tooltip the current buffer encoding.


  • 您可以使用 缓冲文件编码系统

  • 您可以使用
  • $ li $更改下一次保存的整个缓冲区编码b
  • 您还可以更改检测到的编码以强制使用另一种编码,并使用 重新加载文件 bd> RET

  • 您只能使用

  • 还有其他可能,请查看

  • 如果文件混合编码混乱,您可以使用 Mx recode修复部分 -region

  • 如果您想自己进行诊断:


    • 您可以使用从字面上查找Mx查找文件

    • 打开文本文件而无需任何解码或启发式操作,也可以更接近金属(十六进制编辑器)和 Mx hexl-find-file

    • you can see the current encoding with buffer-file-coding-system
    • you can change the whole buffer encoding for next save with
    • you can also change the detected encoding to force an other one and reload the file with
    • you can set an encoding for the next I/O command only with
    • there are some other possibilities, take a look on
    • if the file is a mess with mixed encodings, you can fix portions with M-x recode-region
    • if you want to make a diagnostic by yourself:
      • you can open a text file without any decoding or heuristic with M-x find-file-literally
      • or you can go closer to the metal (hex editor) with M-x hexl-find-file

      在缓冲区内,如果您对字符编码/细节感兴趣,请将其放在中文字符上,然后 会有所帮助。 (不带的内容仅显示有关该字符的一些信息,并且编码不属于该字符。)

      Inside a buffer, if you are interested by a character encoding / details, put the point on a chinese char and will help. (The same without the shows only a few informations about the character, and the encoding is not part of it.)

      这篇关于如何查看emacs中文件的编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 01:15
查看更多