;; Delete codings like `utf-*-with-signature' (they hide BOMs)
;; to allow to always display the BOM (Byte-order mark signature)
;; to be able to remove it without the need to visit files literally
;; or with `C-x RET c utf-8 RET C-x C-f'.
;; SEE ALSO http://thread.gmane.org/gmane.emacs.devel/116668/focus=116738
(setq auto-coding-regexp-alist
(delete (rassoc 'utf-16be-with-signature auto-coding-regexp-alist)
(delete (rassoc 'utf-16le-with-signature auto-coding-regexp-alist)
(delete (rassoc 'utf-8-with-signature auto-coding-regexp-alist)
auto-coding-regexp-alist))))
BOM 头是一个很恶心的东西,如果在 Windows 下面制作好的 Unix 编码的文件,如果在 Mac 上面使用就会遇到 BOM 头的问题。在比较文件内容的时候,你很可能就会被恶心到,因为肉眼看起来完全一样的字符串,比较却是不相等的。