- == utf-8-unix:
Like ‘undecided’ but prefer UTF-8 when appropriate. On decoding, if the source contains 8-bit codes and they all are valid UTF-8 sequences, detect the source as UTF-8 encoding regardless of the coding priority.
On encoding, if the source contains non-ASCII characters, encode them by UTF-8.
Type: undecided (do automatic conversion)
EOL type: LF
U == 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]
(add-to-list 'mode-line-format '(:eval (format " %s" buffer-file-coding-system)))把encoding加到最前面，其他不变