emacs-devel
[Top][All Lists]
Advanced

[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


From: Stephen J. Turnbull
Subject: Re: 23.0.60; Defaut encoding for XML files should be undefined (instead of utf-8)
Date: Tue, 19 Feb 2008 16:17:36 +0900

Miles Bader writes:
 > "Stephen J. Turnbull" <address@hidden> writes:

 > > Do the same thing at visit time by default.  It's not like the
 > > implementation would differ, it's just it would be a post-visit hook
 > > instead of a pre-save hook.
 > 
 > That isn't going to fly.  What are willing to put up with when
 > saving a file is very different from what they're willing to put up
 > when visiting one.

Oh, I think it will indeed fly.  First of all, there will be an Emacsy
"the-user-is-always-right flag"; we're discussing the default here,
which IMO should lean heavily to standard conformance and protecting
the user from automatic decisions they may not understand.

 > I think maybe you misunderstood my proposal.

I missed the detail that you planned to hamstring
`prefer-coding-system', yes.  That's really minor though, in view of
the fundamental disagreement.

My position is that XML has a perfectly acceptable in-band way to
announce encodings.  Contrary to what I understood Stefan to be
saying, it is per-file and required by the standard.[1]  This gives
strong reason to believe that most users will be happy to add text
declarations, especially in free software where they'll be using
high-quality XML implementations.

Furthermore, my position is that in the event that the user chooses
not to use an XML text declaration to declare the encoding, use of
Mule detection mechanisms (including coding: cookies) is just asking
for trouble, because they impose risks both of giving Unicode to users
who want a legacy encoding and of giving a legacy encoding to users
who want Unicode.  The fact that your proposal produces buffers that
*look* like text even though they *are* gibberish according to the
standard (or according to some nonconforming application!) is in no
way a point in its favor!

Of course, Mule's well-tuned detection facilities should be used to
*advise* the user about what encoding is in the buffer, and therefore
what to put in the text declaration or some out of band means of
declaring the encoding.  But in the absence of explicit declaration
(including setting the Emacs-I-dont-need-none-o-yer-XML-lip flag to t)
by the user, the user should be asked to confirm the encoding.

Footnotes: 
[1]  http://www.w3.org/TR/REC-xml/#sec-TextDecl for the definition;
loc. cit. #charencoding for the "MUST".





reply via email to

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