# HG changeset patch # User Jason Rumney # Date 1203302438 0 # Node ID d2f0754ed2f537be41bdf6ae88b5cffeb1cd1e5a # Parent 70ae8b5ec55dca0afa88c5d70adda9630e05620f (xml-find-file-coding-system): Don't warn about utf-16 with BOM. diff -r 70ae8b5ec55d -r d2f0754ed2f5 lisp/international/mule.el --- a/lisp/international/mule.el Mon Feb 18 02:21:44 2008 +0000 +++ b/lisp/international/mule.el Mon Feb 18 02:40:38 2008 +0000 @@ -2341,12 +2341,16 @@ (coding-system-base (detect-coding-region (point-min) (point-max) t))))) ;; Pure ASCII always comes back as undecided. - (if (memq detected '(utf-8 undecided)) - 'utf-8 + (cond + ((memq detected '(utf-8 undecided)) + 'utf-8) + ((eq detected 'utf-16le-with-signature) 'utf-16le-with-signature) + ((eq detected 'utf-16be-with-signature) 'utf-16be-with-signature) + (t (warn "File contents detected as %s. Consider adding an xml declaration with the encoding specified, or saving as utf-8, as mandated by the xml specification." detected) - detected)) + detected))) ;; Don't interfere with the user's wishes for saving the buffer. ;; We did what we could when the buffer was created to ensure the ;; correct encoding was used, or the user was warned, so any