From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: J S Newsgroups: gmane.emacs.bugs Subject: bug#35766: emacs saves utf-16 le xml files as utf-16 be Date: Fri, 17 May 2019 11:26:14 +0000 Message-ID: References: , <837eaqcl9g.fsf@gnu.org>, , , <83lfz5bfed.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_000_BL0PR11MB3475F70B777717241FB7AB449E0B0BL0PR11MB3475namp_" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="221769"; mail-complaints-to="usenet@blaine.gmane.org" Cc: "35766@debbugs.gnu.org" <35766@debbugs.gnu.org> To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri May 17 13:27:13 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hRb17-000vaU-3E for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 May 2019 13:27:13 +0200 Original-Received: from localhost ([127.0.0.1]:46931 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRb16-0005Vc-55 for geb-bug-gnu-emacs@m.gmane.org; Fri, 17 May 2019 07:27:12 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRb0x-0005VP-UK for bug-gnu-emacs@gnu.org; Fri, 17 May 2019 07:27:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRb0w-0005PL-2c for bug-gnu-emacs@gnu.org; Fri, 17 May 2019 07:27:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43997) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRb0v-0005OV-Sb for bug-gnu-emacs@gnu.org; Fri, 17 May 2019 07:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hRb0v-0005Ua-Nx for bug-gnu-emacs@gnu.org; Fri, 17 May 2019 07:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: J S Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 17 May 2019 11:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35766 X-GNU-PR-Package: emacs Original-Received: via spool by 35766-submit@debbugs.gnu.org id=B35766.155809238421051 (code B ref 35766); Fri, 17 May 2019 11:27:01 +0000 Original-Received: (at 35766) by debbugs.gnu.org; 17 May 2019 11:26:24 +0000 Original-Received: from localhost ([127.0.0.1]:57537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRb0J-0005TT-Ir for submit@debbugs.gnu.org; Fri, 17 May 2019 07:26:23 -0400 Original-Received: from mail-oln040092010041.outbound.protection.outlook.com ([40.92.10.41]:28742 helo=NAM04-CO1-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRb0H-0005T7-Nz for 35766@debbugs.gnu.org; Fri, 17 May 2019 07:26:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lU7yi6z0Yso1KFBbXePSgFg8tqiI9OsZjAUTuZVWUXo=; b=a0bEyUFfw73GrVeW46KxkfAjX2QZdUocpywQthUcj+D5C8Hnwu4wcyK7xTbIU5REdiye+LMEjHEVwuYjO/zwIlH/ofMm2xMfDPSSl/uuddEHqLS5U0AAUYgdNqMXJJ8F5V49szJEQcelXbrYt57jR1uFMgRFhcI/Iv6iUbPFqSjmN9JX3EH8dmApaTlEPS/QkXY8lV9GAeypsLuFcHeVVy5DyLgyr3Wpd0nrWWu+7jHKSj7IakCJyTe1vDhlsSrw+qKBZ9OfUmd5WzmNKvZQUGDWIqYtfIClEvwKM2QfBAEn7JFrZ9EsS/VfEr/72hhhNOqkvCnVP/SCZGtHreT07w== Original-Received: from SN1NAM04FT017.eop-NAM04.prod.protection.outlook.com (10.152.88.57) by SN1NAM04HT216.eop-NAM04.prod.protection.outlook.com (10.152.89.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1856.15; Fri, 17 May 2019 11:26:14 +0000 Original-Received: from BL0PR11MB3475.namprd11.prod.outlook.com (10.152.88.60) by SN1NAM04FT017.mail.protection.outlook.com (10.152.88.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1900.16 via Frontend Transport; Fri, 17 May 2019 11:26:14 +0000 Original-Received: from BL0PR11MB3475.namprd11.prod.outlook.com ([fe80::111f:6124:13a4:baec]) by BL0PR11MB3475.namprd11.prod.outlook.com ([fe80::111f:6124:13a4:baec%7]) with mapi id 15.20.1900.010; Fri, 17 May 2019 11:26:14 +0000 Thread-Topic: bug#35766: emacs saves utf-16 le xml files as utf-16 be Thread-Index: AQHVDAo+Qjldgmx4b0y+0fxmDRw/MKZuEJPQgAAOtn2AAAGb0YAAGqeFgADRqwCAACD5gA== In-Reply-To: <83lfz5bfed.fsf@gnu.org> Accept-Language: en-US Content-Language: en-US x-incomingtopheadermarker: OriginalChecksum:ACAE41679960FCB458DA8E333C6E3CFE8592442D94AC6944ED313B22160274FA; UpperCasedChecksum:60BAED002C98FCBDFCAE2933C1D0FD252C2F8774AA3D95E09D4E2383FC29B84F; SizeAsReceived:7100; Count:44 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [JchM+hrzLNOcI4u15illTvrpRt+FHrFI] x-ms-publictraffictype: Email x-incomingheadercount: 44 x-eopattributedmessage: 0 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(5050001)(7020095)(20181119110)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031323274)(2017031324274)(2017031322404)(1601125500)(1603101475)(1701031045); SRVR:SN1NAM04HT216; x-ms-traffictypediagnostic: SN1NAM04HT216: x-ms-exchange-purlcount: 1 x-microsoft-antispam-message-info: MO6aacZ0DYmp+7gYvHVASdqHdmTchoqEB0PtX8z5YcZuoCy5qZtMWjnebCVGm1Jx+mvrlOV/BhRha8jBgXAqSkBmUxpc8HzHqdyIIwE5HTbh3dMkZmu2KS8qYXxtDvh+Eo87uN8SbudCR78v/jxHcwLVUWwk4RhjANcUv+D9FFQm6S4YIXIKT8P+89bjU+zo X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 52430f19-c27c-47e8-0cee-08d6daba78bc X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 May 2019 11:26:14.3216 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1NAM04HT216 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:159441 Archived-At: --_000_BL0PR11MB3475F70B777717241FB7AB449E0B0BL0PR11MB3475namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable It would change color in emacs if encoding=3D"UTF16-LE" were invalid. It's= hard to find the docs for it. UTF-16LE is listed here: http://help.eclip= se.org/kepler/index.jsp?topic=3D%2Forg.eclipse.wst.xmleditor.doc.user%2Ftop= ics%2Fcxmlenc.html ________________________________ From: Eli Zaretskii Sent: Friday, May 17, 2019 9:26 AM To: J S Cc: 35766@debbugs.gnu.org Subject: Re: bug#35766: emacs saves utf-16 le xml files as utf-16 be > From: J S > CC: "35766@debbugs.gnu.org" <35766@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 savin= g in big endian to little endian when > this is the tag: > > 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: > > AFAIU, encoding=3D"UTF-16LE" is invalid in XML. If you see this documented somewhere in XML docs, please tell me where it is described. --_000_BL0PR11MB3475F70B777717241FB7AB449E0B0BL0PR11MB3475namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
It would change color in emacs if encoding=3D"UTF16-LE" were inva= lid.  It's hard to find the docs for it.  UTF-16LE is listed here= :  http://help.ec= lipse.org/kepler/index.jsp?topic=3D%2Forg.eclipse.wst.xmleditor.doc.user%2F= topics%2Fcxmlenc.html



From: Eli Zaretskii <eli= z@gnu.org>
Sent: Friday, May 17, 2019 9:26 AM
To: J S
Cc: 35766@debbugs.gnu.org
Subject: Re: bug#35766: emacs saves utf-16 le xml files as utf-16 be=
 
> From: J S <jszabo_98@hotmail.com>
> CC: "35766@debbugs.gnu.org" <35766@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 preferri= ng saving in big endian to little endian when
> this is the tag:
>
> <?xml version=3D"1.0" encoding=3D"UTF-16"?><= br>
This is the default, yes.  "C-h C utf-16 RET" says:

  UTF-16 (detect endian on decoding, use big endian on encoding with B= OM).
            &nb= sp;            =             ^^^^^^^^= ^^^^^^^^^^^^^^^^^^^^^^^^^^^
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=3D"1.0" encoding=3D"UTF-16LE"?>= ;

AFAIU, encoding=3D"UTF-16LE" is invalid in XML.  If you see = this
documented somewhere in XML docs, please tell me where it is
described.
--_000_BL0PR11MB3475F70B777717241FB7AB449E0B0BL0PR11MB3475namp_--