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

Package: emacs;

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


View this message in rfc822 format

From: Vincent Lefevre <vincent <at> vinc17.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: rgm <at> gnu.org, a.s <at> realize.ch, monnier <at> iro.umontreal.ca, 20623 <at> debbugs.gnu.org, sledergerber <at> gmx.net
Subject: 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
Date: Sat, 11 Aug 2018 17:41:01 +0200
On 2018-08-11 13:45:17 +0300, Eli Zaretskii wrote:
> > Date: Sat, 11 Aug 2018 12:13:41 +0200
> > From: Vincent Lefevre <vincent <at> vinc17.net>
> > Cc: monnier <at> iro.umontreal.ca, rgm <at> gnu.org, sledergerber <at> gmx.net,
> > 	a.s <at> realize.ch, 20623 <at> debbugs.gnu.org
> > 
> > On 2018-08-11 12:15:31 +0300, Eli Zaretskii wrote:
> > > In this case, I cannot but express my extreme surprise to see such a
> > > minor issue described as "grave".  The alleged data loss is minor, if
> > > it exists at all (the BOM is not data important for the user,
> > 
> > You're completely wrong. The presence of BOM or not is very important
> > for some applications, such as Firefox (not to determine the charset,
> > but the MIME type of local files).
> 
> Please provide the details, including the use case, if possible.  I'm
> still in the dark regarding the importance of the BOM in UTF-8 encoded
> HTML stuff.

  https://bugzilla.mozilla.org/show_bug.cgi?id=1422889

for HTML. Wontfix because of:

  https://mimesniff.spec.whatwg.org/#mime-type-sniffing-algorithm

For text/plain only (but this is another example that BOM can matter
in practice), there's

  https://bugzilla.mozilla.org/show_bug.cgi?id=1071816

(which is a bug that should be fixed).

> > It can be repaired, but the problems are the user doesn't know
> > what's going on and this breaks things.
> 
> I agree about the user not knowing, but that doesn't yet qualify as
> "data loss", which has an widely accepted meaning.

This is data corruption, which is a form of data loss, because some
information is lost in the process (I recall that Emacs does not
provide any information to the user about this transformation).

-- 
Vincent Lefèvre <vincent <at> vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)




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.