[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 23.0.60; Defaut encoding for XML files should be undefined (instead
Re: 23.0.60; Defaut encoding for XML files should be undefined (instead of utf-8)
Sat, 16 Feb 2008 08:24:04 +0900
Jason Rumney <address@hidden> writes:
> Emacs goes beyond doing the right thing at the moment. The right thing
> would be to guide users into using utf-8 by making that the default
> encoding for *new* XML files, and perhaps warning if an existing file
> was detected as non-utf-8 without a charset declaration in the
> header. Forcing users into using utf-8 by ignoring explicit requests to
> save the file as latin-1 and by opening latin-1 encoded files as utf-8
> even when the decoding fails is not the right behaviour. Our users are
> not slaves to specifications.
Perhaps the "best" thing would be to temporarily do a
(prefer-coding-system 'utf-8) when reading xml files without an encoding
header, instead of _forcing_ the coding system to be utf-8.
However it doesn't look like the current Emacs mechanism for
format-specific coding systems (`auto-coding-functions') explicitly
supports functionality. Maybe sgml-xml-auto-coding-function could use
whatever lower-level function does coding-system-detection using only
the characters in the buffer (I can't seem to find it, but there must be
such a thing...).
Scriptures, n. The sacred books of our holy religion, as distinguished from
the false and profane writings on which all other faiths are based.
Re: 23.0.60; Defaut encoding for XML files should be undefined (instead of utf-8), Stefan Monnier, 2008/02/15