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!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: unicode and wide_text_io Date: Wed, 27 Dec 2017 21:04:26 +0100 Organization: Aioe.org NNTP Server Message-ID: References: NNTP-Posting-Host: TliDXSPe+gBSGCqP3SEJ2Q.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 X-Notice: Filtered by postfilter v. 0.8.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:49660 Date: 2017-12-27T21:04:26+01:00 List-Id: On 2017-12-27 19:08, Mehdi Saada wrote: > I would like to avoid rewriting an I-O related package, which would > prove tiresome to the end. As it is, it uses UTF8 (so TEXT_IO), Ada.Text_IO is Latin-1, at least formally. Use Stream I/O instead if you don't want surprises. > but for ONE, only ONE character, I need to "put" WIDE_TEXT_IO. No, you don't. Wide Text_IO is UCS-2. Keep on using UTF-8. You probably meant output of code points. That is a different beast. Convert a code point to UTF-8 string and output that. E.g.: function Image (Value : UTF8_Code_Point) return String; here http://www.dmitry-kazakov.de/ada/strings_edit.htm#Strings_Edit.UTF8 For example: Image (16#F8D0#) & Image (16#F8D3#) & Image (16#F8D0#) would be "ADA" in Klingon. They seem don't know that the proper spelling is "Ada", but what would you expect from them? (:-)) > The slash character ⁄ would allow better looking fractions for > outputting rationnals, since it's meant to tell the terminal to > consider numbersbefore and after as superscript and subscript, > respectively. Why don't you simply output super- or subscript digits in UTF-8? http://www.dmitry-kazakov.de/ada/strings_edit.htm#7.3 Use Image (Number) from the package instance. That is. > Is there a way in unicode in UTF8 to shift outside of UTF8 ? I don't understand the meaning of this question. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de