GNU bug report logs -
#21780
25.0.50; Saving *Help* results in bad encoding because of curly quotes
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Thu, 29 Oct 2015 01:52:02 UTC
Severity: normal
Found in version 25.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #37 received at 21780 <at> debbugs.gnu.org (full text, mbox):
> Date: Fri, 30 Oct 2015 09:02:15 -0700 (PDT)
> From: Drew Adams <drew.adams <at> oracle.com>
> Cc: 21780 <at> debbugs.gnu.org
>
> > > (setq-default buffer-file-coding-system 'undecided-unix)
> >
> > That's your problem, mot probably. Can you try again after removing
> > it? If that solves the problem, I can then tell you how to do what
> > you want without disrupting encoding/decoding defaults.
> >
> > > And I do this:
> > > (setq process-coding-system-alist
> > > (cons '("bash" . (raw-text-dos . raw-text-unix))
> > > process-coding-system-alist))
> >
> > This is not related, but it is also wrong. Why do you do that?
>
> Why are these things "wrong"?
Because they defeat some of the heuristics that decoding and encoding
needs to silently DTRT. Whoever wrote them didn't understand what she
was doing, and most probably didn't understand what is the problem
that needed to be solved.
If you want to have Unix EOLs by default, the correct customization is
this:
(setq-default buffer-file-coding-system
(coding-system-change-eol-conversion
buffer-file-coding-system 'unix))
This modifies just the EOL type of the default encoding, leaving the
rest intact.
The other customization, for process-coding-system-alist, is a very
bad idea, if your Bash can sometimes report non-ASCII strings. AFAIK,
Cygwin nowadays uses UTF-8 as its encoding, so the correct
customization would be to use utf-8 instead of raw-text there.
> I do them as part of the setup to use Cygwin. I do them in
> `setup-cygwin.el', which is, incidentally, used by quite a few
> people AFAIK.
> http://www.emacswiki.org/emacs/download/setup-cygwin.el
That file needs this fixed ASAP.
> Anyway, I tried commenting out the first of those. That did
> change the text of the *Warning* buffer, so that it mentioned
> utf-8 as one of the possibilities. (Unfortunately, I still
> cannot get the file saved, because Emacs crashes. Again, the
> autosave file looks fine in a new session, and shows U(Unix)
> in the mode line.)
The crash is some separate problem, it doesn't crash for me.
Anyway, this is all tangential to the problem. After the file is
saved as UTF-8, does visiting it display it correctly, after you
correct your customizations as indicated above? If not, you will have
to use "C-x RET c" or "C-x RET r", as I mentioned earlier.
This bug report was last modified 9 years and 210 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.