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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: unicode and wide_text_io Date: Thu, 28 Dec 2017 14:32:06 +0000 Organization: A noiseless patient Spider Message-ID: References: <892d5b9a-6460-419a-a09d-d00a4b84c668@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="ea0091a2e59664c1c018e961882bc7ce"; logging-data="15453"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19d5hOK7lpanUl2VE5QrwpbYbi/dWTgapY=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:VcmDJpdsMXVaJKRbpgIsED21ej0= sha1:0iAOhfgdrStx7287IyKffKLVYgY= Xref: reader02.eternal-september.org comp.lang.ada:49678 Date: 2017-12-28T14:32:06+00:00 List-Id: "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!)