GNU bug report logs - #10383
24.0.91; (prefer-coding-system 'utf-8-with-signature) breaks the world

Previous Next

Package: emacs;

Reported by: Eric Hanchrow <eric.hanchrow <at> gmail.com>

Date: Tue, 27 Dec 2011 22:28:02 UTC

Severity: normal

Found in version 24.0.91

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 10383 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Kenichi Handa <handa <at> m17n.org>
Cc: Eric Hanchrow <eric.hanchrow <at> gmail.com>, 10383 <at> debbugs.gnu.org
Subject: Re: bug#10383: 24.0.91;
	(prefer-coding-system 'utf-8-with-signature) breaks the world
Date: Wed, 28 Dec 2011 05:49:53 -0500
> This is because utf-8-with-signature is recognized as ASCII
> compatible and thus default-file-coding-system is also set
> to it.  I've just committed a fix to make
> utf-8-with-signature not ASCII compatible.  Please try
> again with the latest trunk code.

That looks like a good fix.

> By the way, as a result, now
>     (prefer-coding-system 'utf-8-with-signature)
> does not change default-file-coding-system.

That's fine.  A call to `message' might be a good addition to help the
user understand that his config might not be doing what she expects.

> I'm not sure what is the intention of preferring utf-8-with-signature,
> one may want default-file-coding-system be set to utf-8 in such
> a case.

I wouldn't waste too much time on it.

> But, doing that automatically is too heuristic.  Another possibility
> is that what actually wanted is such a coding as
> utf-8-with-signature-on-decoding-only (i.e. on decoding, BOM is
> recognized, but on encoding, don't produce BOM).

Not necessarily.  My guess is that the user doesn't realize that
coding-systems are not only used to load and save whole files but also
on chunks of texts in lots of other cases, where a BOM doesn't make
any sense.


        Stefan




This bug report was last modified 13 years and 196 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.