]> git.eshelyaron.com Git - emacs.git/commitdiff
(xml-find-file-coding-system): Don't warn about utf-16 with BOM.
authorJason Rumney <jasonr@gnu.org>
Mon, 18 Feb 2008 02:41:11 +0000 (02:41 +0000)
committerJason Rumney <jasonr@gnu.org>
Mon, 18 Feb 2008 02:41:11 +0000 (02:41 +0000)
lisp/ChangeLog
lisp/international/mule.el

index 7c814c4c2e356d690cdb23e6ed1857fc7c446e80..24800d3bad1ecd43458cb72196c8a21c8e2abd1f 100644 (file)
@@ -1,5 +1,8 @@
 2008-02-18  Jason Rumney  <jasonr@gnu.org>
 
+       * international/mule.el (xml-find-file-coding-system): Don't warn
+       about utf-16 with BOM.
+
        * nxml/nxml-mode.el (nxml-mode): Don't add a write-contents-hook.
 
        * international/mule.el (sgml-xml-auto-coding-function): Detect
index 7952c7a6878af3fcc77976011579b0352bb7de19..d6305814a09f83ff42c7e7df42846fdb771a8a98 100644 (file)
@@ -2341,12 +2341,16 @@ added by processing software."
                (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