When an xml file just says encoding="UTF-16", how does an application pick big endian vs little endian? ________________________________ From: npostavs@gmail.com Sent: Friday, May 17, 2019 4:27 PM To: Eli Zaretskii Cc: Noam Postavsky; jszabo_98@hotmail.com; 35766@debbugs.gnu.org Subject: Re: bug#35766: emacs saves utf-16 le xml files as utf-16 be Eli Zaretskii writes: > Perhaps we should by default produce encoding with BOM when XML header > specifies UTF-16? I think yes, https://www.w3.org/TR/xml/#charencoding says Entities encoded in UTF-16 MUST [...] begin with the Byte Order Mark By the way, is Bug#8282 the same as this one, or just closely related? It's talking about sgml-html-meta-auto-coding-function (though maybe sgml-xml-auto-coding-function is more relevant). I'm getting a little confused between all the different *-find/auto-coding-* functions. There is also nxml-set-auto-coding which seems to be mostly unused.