GNU bug report logs - #35766
emacs saves utf-16 le xml files as utf-16 be

Previous Next

Package: emacs;

Reported by: J S <jszabo_98 <at> hotmail.com>

Date: Thu, 16 May 2019 17:58:01 UTC

Severity: normal

Merged with 8282, 8283

Fixed in version 27.1

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: J S <jszabo_98 <at> hotmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: "35766 <at> debbugs.gnu.org" <35766 <at> debbugs.gnu.org>
Subject: bug#35766: emacs saves utf-16 le xml files as utf-16 be
Date: Fri, 17 May 2019 11:26:14 +0000
[Message part 1 (text/plain, inline)]
It would change color in emacs if encoding="UTF16-LE" were invalid.  It's hard to find the docs for it.  UTF-16LE is listed here:  http://help.eclipse.org/kepler/index.jsp?topic=%2Forg.eclipse.wst.xmleditor.doc.user%2Ftopics%2Fcxmlenc.html


________________________________
From: Eli Zaretskii <eliz <at> gnu.org>
Sent: Friday, May 17, 2019 9:26 AM
To: J S
Cc: 35766 <at> debbugs.gnu.org
Subject: Re: bug#35766: emacs saves utf-16 le xml files as utf-16 be

> From: J S <jszabo_98 <at> hotmail.com>
> CC: "35766 <at> debbugs.gnu.org" <35766 <at> debbugs.gnu.org>
> Date: Thu, 16 May 2019 20:57:34 +0000
>
> I should say that I'm using emacs for windows.  And it's preferring saving in big endian to little endian when
> this is the tag:
>
> <?xml version="1.0" encoding="UTF-16"?>

This is the default, yes.  "C-h C utf-16 RET" says:

  UTF-16 (detect endian on decoding, use big endian on encoding with BOM).
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
If you want to encode in UTF-16LE, you need to tell Emacs to do this
explicitly:

  C-x RET c utf-16le-with-signature RET C-x C-s

> Try saving this xml file and opening it again:
>
> <?xml version="1.0" encoding="UTF-16LE"?>

AFAIU, encoding="UTF-16LE" is invalid in XML.  If you see this
documented somewhere in XML docs, please tell me where it is
described.
[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.