bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#20623: XML and HTML files with encoding/charset="utf-8" declaration


From: Stefan Monnier
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: Fri, 22 May 2015 11:22:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> 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.  IOW the
utf-8 annotation in the XML metadata shouldn't mean "use the utf-8
coding system" but "use a coding system compatible with utf-8".  So if
the coding system is already compatible with utf-8
(e.g. utf-8-with-signature), we should simply keep using that rather
than switch to the utf-8 coding-system.


        Stefan






reply via email to

[Prev in Thread] Current Thread [Next in Thread]