[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto-detecting encoding for XML

From: Eli Zaretskii
Subject: Re: auto-detecting encoding for XML
Date: Mon, 20 May 2002 07:48:27 +0300 (IDT)

On 18 May 2002, Colin Walters wrote:

> +     (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)
> +                 ((string-match "iso-8859-[[:digit:]]+" match)
> +                  (intern match))
> +                 (t nil)))

Why didn't you use `intern' in all cases?  If you are bothered by the 
possibility that the resulting symbol is not a valid coding system, you 
can check that with coding-system-p.

Btw, does this change honor "C-x RET c"?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]