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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fe66ebb10f69d726 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.129.169 with SMTP id nx9mr19682582pbb.2.1330999133577; Mon, 05 Mar 2012 17:58:53 -0800 (PST) MIME-Version: 1.0 Path: h9ni44131pbe.0!nntp.google.com!news2.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!news2.arglkargh.de!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Convert wide_string to string (as the same byte array) Date: Mon, 5 Mar 2012 19:58:48 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1330999132 6307 69.95.181.76 (6 Mar 2012 01:58:52 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 6 Mar 2012 01:58:52 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-03-05T19:58:48-06:00 List-Id: "Erich" wrote in message news:f88cc8ca-183a-40c7-a01c-2adc1137d845@b18g2000vbz.googlegroups.com... >A newbie question: I need to convert a wide_string to a (platform/ > endian independent) string that represents all the bytes of the > wide_string. How do you do that? An alternative to Adam's solution would be to use the Ada2012 encoding functions (A.4.11), specifically Ada.Strings.UTF_Encoding.Wide_Strings, and use a UTF-8 encoding. That would be shorter, but not fixed length, so whether that would work for you depends on the API you are feeding these into. Randy.