2013-08-17 23 views
4

或者我應該使用哪一個用於哪些目的?我是否認爲utf-8-emacs編碼系統適用於emacs lisp文件,而utf-8適用於文本文件?Emacs上utf-8-emacs和utf-8的區別

M-x describe-coding-system上的兩個回報:

U -- utf-8-emacs 

Support for all Emacs characters (including non-Unicode characters). 
Type: utf-8 (UTF-8: Emacs internal multibyte form) 
EOL type: Automatic selection from: 
     [utf-8-emacs-unix utf-8-emacs-dos utf-8-emacs-mac] 
This coding system encodes the following charsets: 
    emacs 


U -- utf-8 (alias: mule-utf-8) 

UTF-8 (no signature (BOM)) 
Type: utf-8 (UTF-8: Emacs internal multibyte form) 
EOL type: Automatic selection from: 
     [utf-8-unix utf-8-dos utf-8-mac] 
This coding system encodes the following charsets: 
    unicode 

不知道什麼是

Support for all Emacs characters (including non-Unicode characters). 

回答

3

utf-8-emacs意味着支持其他字符,如二進制數據的內部表示。由於這是Unicode的非標準擴展,因此爲其定義了單獨的編碼,因此如果使用utf-8,則不會意外地包含這些可能會混淆其他軟件的非標準擴展。

對於elisp,您可以使用任何一種編碼,除非您需要包含二進制數據或不含Unicode的字符,否則不會產生任何影響。

1

utf-8-emacs是Emacs內部使用的編碼。它在一些地方可見(例如自動保存文件),但作爲一般規則,除非您知道自己在做什麼,否則不應使用它。

相關問題