Subject: bug#21780: 25.0.50; Saving *Help* results in bad encoding because of curly quotes

From: Eli Zaretskii <[email-masked]>
Date: Fri, 30 Oct 2015 09:47:48 +0200

> Date: Thu, 29 Oct 2015 13:53:30 -0700 (PDT)
> From: Drew Adams <[email-masked]>
> Cc: [email-masked]
> 
> I think now that what I did earlier, when specified utf-8, I was
> using my setup.  When I try that again (with my setup), I see the
> problem I reported.

So the question now becomes what do you have in your setup that causes
this.  I'm guessing you do something that changes the defaults for
encoding/decoding text.

> Also, with my setup the *Warning* text is different.  Instead of
> providing lots of possible encoding choices and using
> chinese-iso-8bit as the default (which is what I get with emacs
> -Q - why is that, BTW?), it says:
> 
> Select one of the safe coding systems listed below,
> or cancel the writing with C-g and edit the buffer
>    to remove or modify the problematic characters,
> or specify any other coding system (and risk losing
>    the problematic characters).
> 
>   raw-text no-conversion

What its suggests depend on your customizations.

> The full warning is this, when I use my setup (which uses font
> "-outline-Lucida Console-normal-normal-normal-mono-14-*-*-*-c-*-iso8859-1"):

The font has nothing to do with this.
> >   . If the curved quotes look like raw bytes or, worse, pairs of
> >     non-ASCII characters, you need to visit such file like this:
> > 
> >       C-x RET c utf-8 RET C-x C-f FILE-NAME RET
> 
> Users should not have to do that.

They have been doing that since Emacs 20.1.  This is how you visit a
file whose encoding Emacs cannot guess correctly.  You just didn't
have the pleasure of bumping into this problem until now.

Another possibility is to visit the file normally, see that it wasn't
decoded correctly, then type "C-x RET r utf-8 RET", which will revisit
the file using the specified encoding.

> > UTF-8 should have worked.  I wouldn't expect you to see octal escapes
> > after saving in UTF-8.
> 
> See above for, I think, the explanation of what I did and saw.

It doesn't.  You have something in your customizations that runs afoul
of your expectations (which do work in "emacs -Q").