The difference between utf-8-emacs and utf-8 on emacs

Or which one should I use for what purpose? Do I believe that the utf-8-emacs encoding system is for emacs lisp files, and utf-8 is for text files?

Mx describe-coding-system for two returns:

 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 

Not sure what is meant by

 Support for all Emacs characters (including non-Unicode characters). 
+4
source share
2 answers

utf-8-emacs supports extra characters, such as the internal representation of binary data. Since this is a non-standard Unicode extension, a separate encoding was defined for it, so if you use utf-8 , you will not accidentally turn on these non-standard extensions, which may confuse other software.

You can use either encoding for elisp, if you do not need to include binary data or obscure characters that are not part of Unicode, this will not affect.

+3
source

utf-8-emacs is the encoding used inside Emacs. It appears in several places (for example, files with automatic saving), but as a rule, you should never use it if you do not know what you are doing.

+1
source

Source: https://habr.com/ru/post/1497533/


All Articles