From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Exclusive file access Date: Sun, 30 Aug 2015 14:44:46 +0200 Organization: cbb software GmbH Message-ID: References: <75714e3f-c047-413d-9aa5-3ff423167863@googlegroups.com> <1440837116.20971.33.camel@obry.net> <87oahpovpn.fsf@mid.deneb.enyo.de> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: j5pd6+YW13W3aOTpCbIMJw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="big5" Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:27641 Date: 2015-08-30T14:44:46+02:00 List-Id: On Sun, 30 Aug 2015 13:35:16 +0200, Florian Weimer wrote: > * Dmitry A. Kazakov: > >> No, I meant Wide_Wide_String. >> >> Ada's Wide_String is legally UCS-2. Windows is UTF-16. The only full >> Unicode string type is Wide_Wide_String. For an Indo-European language >> there is no difference, of course. > > GNAT's Wide_String should be compatible with UTF-16. In the sense that Wide_String is an array of 0..2**16-1 units of the endianness compatible to UTF-16, yes. However the standard is silent about endianness and alignment (a DSP processor might deploy 32-bit units per unit) Semantically no. Wide_String according to RM 3.5.2 (3/3) represents a narrower set of Unicode than UTF-16. > Wide_Wide_String definitely is not. Definitely is. Both are to represent arrays of same sets of Unicode characters. The representation of Wide_Wide_String is of course irrelevant when used to specify an external file name, right? >> Under Linux most applications simply ignore Ada standard and use String >> encoded in UTF-8. I suppose that under Linux GNAT calmly passes String file >> names as-is, i.e. as UTF-8 [*]. > > I think GNAT just passes around bytes, it does not care if it's UTF-8 > or a legacy encoding. Yes, which is clearly against RM 3.5.2 (2/3) as the example illustrates. The point is that the behavior one would imply from 3.5.2 and Ada.Text_IO specification would be useless. > As long as you don't use Wide_StringˇXif you do use that, things get rather messy. Both are messy. Character and Ada.Text_IO was designed prior to Unicode. Later amendments were futile attempts to repair what needed no repair. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de