]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix decoding XML files encoded in ISO-8859
authorEli Zaretskii <eliz@gnu.org>
Mon, 19 Nov 2018 16:36:42 +0000 (18:36 +0200)
committerEli Zaretskii <eliz@gnu.org>
Mon, 19 Nov 2018 16:36:42 +0000 (18:36 +0200)
* lisp/international/mule.el (sgml-xml-auto-coding-function):
Avoid signaling an error from coding-system-equal when the XML
encoding tag specifies an encoding whose type is 'charset'.
(Bug#33429)

lisp/international/mule.el

index 1488810002077d90cbe4e680453e49cd6c2769a0..979845b72335ff0685b8558c1989f63f65dca77e 100644 (file)
@@ -2500,7 +2500,11 @@ This function is intended to be added to `auto-coding-functions'."
                   (let ((sym-type (coding-system-type sym))
                         (bfcs-type
                          (coding-system-type buffer-file-coding-system)))
-                    (if (and (coding-system-equal 'utf-8 sym-type)
+                    ;; 'charset' will signal an error in
+                    ;; coding-system-equal, since it isn't a
+                    ;; coding-system.  So test that up front.
+                    (if (and (not (equal sym-type 'charset))
+                             (coding-system-equal 'utf-8 sym-type)
                              (coding-system-equal 'utf-8 bfcs-type))
                         buffer-file-coding-system
                      sym))