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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b1a601cc75c5fb67 X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: String type conversions Date: 1999/02/09 Message-ID: #1/1 X-Deja-AN: 442576745 References: <36C08E00.C3904670@Botton.com> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1999-02-09T00:00:00+00:00 List-Id: In article <36C08E00.C3904670@Botton.com> David Botton writes: > What is the best way to convert back forth between: > Wide_String to/from String Is this a trick question? To convert from String to Wide_String is easy, call Ada.Characters.Handling.To_Wide_String. ;-) To go in the other direction, there is a To_String function. But what you may really need is something with a better mapping for Wide_Characters not in Character. Note that you may want to make sure your Character type is Latin-1 and not some other character set if you are using upper page characters. > wchar_array to/from char_array Do I send you to the C newsgroup? Or just tell you that there is no Ada defined mapping from one to the other, and the actual mapping will be OS and compiler specific. It is a shame that the character mapping arena is such a mess. That is not an Ada issue, quite the opposite, in Ada it is a lot less messy than in some other languages. It is just that there are so many standard, pseudo-standard, and non-standard character sets out there. -- Robert I. Eachus with Standard_Disclaimer; use Standard_Disclaimer; function Message (Text: in Clever_Ideas) return Better_Ideas is...