From: Colin Walters Date: Tue, 21 May 2002 21:50:28 +0000 (+0000) Subject: (sgml-xml-auto-coding-function): Update with more known XML encodings. X-Git-Tag: ttn-vms-21-2-B4~14923 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2f4e9c4745f53dc9faf1f3dc5fbb750ab9cdc3ff;p=emacs.git (sgml-xml-auto-coding-function): Update with more known XML encodings. --- diff --git a/lisp/international/mule.el b/lisp/international/mule.el index b2ec27dc3b0..c01ff2e4eb6 100644 --- a/lisp/international/mule.el +++ b/lisp/international/mule.el @@ -1928,17 +1928,17 @@ This function is intended to be added to `auto-coding-functions'." (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))))) ;;;