# HG changeset patch # User Colin Walters # Date 1022017828 0 # Node ID 8da743b93fbf7c0c56c06ca9965d032fcc96558f # Parent 1a864f82e0cb6bf67fafafb5e6a099a35accce4d (sgml-xml-auto-coding-function): Update with more known XML encodings. diff -r 1a864f82e0cb -r 8da743b93fbf lisp/international/mule.el --- a/lisp/international/mule.el Tue May 21 21:35:49 2002 +0000 +++ b/lisp/international/mule.el Tue May 21 21:50:28 2002 +0000 @@ -1928,17 +1928,17 @@ (when (re-search-forward "\\`[[:space:]\n]*<\\?xml") (let ((end (save-excursion ;; This is a hack. - (search-forward "\"\\s-*?>" size t)))) + (re-search-forward "\"\\s-*\\?>" size t)))) (when end (if (re-search-forward "encoding=\"\\(.+?\\)\"" end t) (let ((match (downcase (match-string 1)))) - ;; FIXME: what other encodings are valid, and how can we - ;; translate them to the names of coding systems? - (cond ((string= match "utf-8") - 'utf-8) + (cond ((member match '("utf-8" "iso-2022-jp" + "euc-jp" "shift_jis")) + (intern match)) ((string-match "iso-8859-[[:digit:]]+" match) (intern match)) - (t nil))) + (t (message "Warning: unknown XML encoding %s" match) + nil))) 'utf-8))))) ;;;