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=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Community Input for the Maintenance and Revision of the Ada Programming Language Date: Thu, 31 Aug 2017 11:52:01 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <79e06550-67d7-45b3-88f8-b7b3980ecb20@googlegroups.com> <9d4bc8aa-cc44-4c30-8385-af0d29d49b36@googlegroups.com> <1395655516.524005222.638450.laguest-archeia.com@nntp.aioe.org> <4527d955-a6fe-4782-beea-e59c3bb69f21@googlegroups.com> <22c5d2f4-6b96-4474-936c-024fdbed6ac7@googlegroups.com> <1919594098.524164165.354468.laguest-archeia.com@nntp.aioe.org> <85d4930c-d4dc-4e4f-af7a-fd7c213b8290@googlegroups.com> <725b229b-f768-4603-b564-4751e5e7136f@googlegroups.com> <87ziag9ois.fsf@jacob-sparre.dk> NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:47851 Date: 2017-08-31T11:52:01+02:00 List-Id: On 31/08/2017 09:36, Jacob Sparre Andersen wrote: > Robert Eachus wrote: > >> There is an 'elegant' solution. Add a UTF8 character string type. > > Wouldn't it be more elegant to redefine Character to cover all Unicode > code-points? (And make Wide_Character and Wide_Wide_Character renamings > (i.e. subtypes) of Character.) The Latin-N character sets will of > course have to be declared as subtypes of Character, and I/O > serialization will have to be told of character encodings. > > I can imagine that there may be some incompabilities from making such a > change, but what are they? You need a view of a string as an array of code points / unicode characters *and* another view as an array of encoding items, e.g. octet for UTF-8 or word for UTF-16 etc. UTF-16 and UTF-8 strings are equivalent types in the view of code point arrays. UCS-2 is a constrained subtype of both. ASCII string is a constrained subtype of any. In the second view ASCII string is a subtype of only UTF-8 string. It is an unrelated type to UCS-2 and UTF-16. You cannot handle this in present Ada. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de