GNU bug report logs - #22436
read-coding-system uses wrong default when called from write-file

Previous Next

Package: emacs;

Reported by: Richard Copley <rcopley <at> gmail.com>

Date: Fri, 22 Jan 2016 19:32:01 UTC

Severity: minor

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Richard Copley <rcopley <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22436 <at> debbugs.gnu.org
Subject: bug#22436: read-coding-system uses wrong default when called from write-file
Date: Sat, 23 Jan 2016 09:45:39 +0000
On 23 January 2016 at 05:56, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> From: Richard Copley <rcopley <at> gmail.com>
>> Date: Fri, 22 Jan 2016 23:23:40 +0000
>> Cc: 22436 <at> debbugs.gnu.org
>>
>> On 22 January 2016 at 21:23, Eli Zaretskii <eliz <at> gnu.org> wrote:
>> >> From: Richard Copley <rcopley <at> gmail.com>
>> >> Date: Fri, 22 Jan 2016 19:31:07 +0000
>> >>
>> >> >From "emacs -Q", enter a ‘ in the scratch buffer (e.g., by typing "C-x
>> >> 8 ["). Save or write the buffer. The minibuffer prompts "Select coding
>> >> system (default chinese-iso-8bit): ".
>> >
>> > Why do you think that's wrong?
>>
>> Of course it's wrong. What do you mean?
>
> Wrong how? in what way? what did you expect to happen instead?

Wrong in the ordinary sense of the word, in that it is not right.
It is however exactly what I expected.

> Your locale's default encoding, cp1252, cannot encode this character,
> so Emacs asked you to provide an encoding that can, and offered
> chinese-iso-8bit as the default.

Yes.

> An encoding can be considered "wrong" if it fails to encode a
> character.  AFAICS, chinese-iso-8bit does succeed in encoding it, so
> the above definition of "wrong" doesn't fit.

It encodes the character to #xa1 #xae . When I open the file that is
decoded as "¡®", without asking any questions. Isn't that what you
saw? Are you going to tell me that's right too?

> In addition, there should be a *Warning* buffer displayed where you
> have a long list of encodings Emacs knows about that can encode this
> character; chinese-iso-8bit is just one of them, but the text there
> tells you to select any one of them.  Do you see that buffer
> displayed?

Yes, but chinese-iso-8bit is not on the list.

> Given all this information, please do tell why you think what Emacs
> did was wrong,

Do you seriously think it's the right thing to do? That's the last thing
I expected. I don't know how to respond.

> and what did you think Emacs should have done instead.

I think Emacs should pick something less surprising and unhelpful,
like utf-8.




This bug report was last modified 9 years and 173 days ago.

Previous Next


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