GNU bug report logs -
#20623
XML and HTML files with encoding/charset="utf-8" declaration lose BOM; Coding system is reset from utf-8-with-signature to utf-8 on save
Previous Next
Reported by: Simon Ledergerber <sledergerber <at> gmx.net>
Date: Thu, 21 May 2015 18:53:02 UTC
Severity: normal
Found in version 26.1
Fixed in version 26.2
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #29 received at 20623 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
As already mentioned in my last post, even when I started Emacs with the option -Q, which should opt out my customizations, it made no difference. So naturally, the source of the problem will be somewhere else.
-----Original Message-----
From: "Eli Zaretskii" <eliz <at> gnu.org>
Sent: 23.05.2015 08:44
To: "Stefan Monnier" <monnier <at> iro.umontreal.ca>
Cc: "sledergerber <at> gmx.net" <sledergerber <at> gmx.net>; "20623 <at> debbugs.gnu.org" <20623 <at> debbugs.gnu.org>
Subject: Re: bug#20623: XML and HTML files with encoding/charset="utf-8" declaration loose BOM; Coding system is reset from utf-8-with-signature to utf-8 on save
> From: Stefan Monnier <monnier <at> iro.umontreal.ca>
> Cc: sledergerber <at> gmx.net, 20623 <at> debbugs.gnu.org
> Date: Fri, 22 May 2015 17:51:07 -0400
>
> >> > What would you expect Emacs to do instead? It just obeys the stated
> >> > encoding, which says nothing about the BOM. How can Emacs know when
> >> > to use utf-8 and when utf-8-with-signature?
> >> To the extent that Emacs has seen the BOM when opening the file, it
> >> would make sense for Emacs to try and preserve this detail.
> > It does.
>
> While there are cases where it does, this bug report is about a case
> where it doesn't, IIUC.
AFAIU, that happened because the user has this in ~/.emacs:
(setq-default buffer-file-coding-system 'utf-8-dos)
IMO, this bad customization should be removed, and then the problem
will go away.
[Message part 2 (text/html, inline)]
This bug report was last modified 6 years and 279 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.