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!feeder.eternal-september.org!news.albasani.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: unicode and wide_text_io Date: Thu, 28 Dec 2017 17:28:37 +0200 Organization: Tidorum Ltd Message-ID: References: <892d5b9a-6460-419a-a09d-d00a4b84c668@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 5i/46Xm8FO7nelKNGIVeigxM4/JKknxhZeoka4jnYpoEKYHLPL Cancel-Lock: sha1:+8iDDPKlqLw8NBNtBGXar7QJHsw= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 In-Reply-To: Xref: reader02.eternal-september.org comp.lang.ada:49679 Date: 2017-12-28T17:28:37+02:00 List-Id: On 17-12-28 16:32 , Simon Wright wrote: > "Dmitry A. Kazakov" writes: > >> On 2017-12-28 14:15, Mehdi Saada wrote: >> >>> Ok, I'm done with it. It sure is interesting, but I don't want to >>> even think about all this stuff for the time being... Talk about >>> "universal standard", when it's (apparently) it's far from universal >>> or uniform ! >> >> It is. Everybody uses UTF-8. Even under Windows. The text is converted >> from/to UTF-16 right after or before passing it to the system >> call. All processing is UTF-8. E.g. GTK uses UTF-8 consistently no >> matter what OS. >> >>>> Easy: it uses a variable-width representation. >>> Under the assumption terminals will be able to display it... well, >>> whatever I use in the end, I've got to suppose it anyway. >> >> Sure they are Linux and Windows. >> >> Take this program: >> ------------------------------------ >> with Ada.Text_IO; use Ada.Text_IO; >> procedure Superscript is >> begin >> Put_Line >> ( "Superscript 1=" >> & Character'Val (194) >> & Character'Val (185) >> ); >> end Superscript; >> ------------------------------------ > > works fine on macOS (no chcp messing needed!) Depends on the Preferences (-> Settings -> Advanced: Character encoding) you set for the Mac Terminal program. While UTF-8 is one of the available encodings, I normally have it set to Latin-1, to match Ada and GNAT. Latin-1 is fine for the languages I mostly use (English, Swedish, Finnish). -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .