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.135.231 with SMTP id pv7mr3776130pbb.8.1330124385336; Fri, 24 Feb 2012 14:59:45 -0800 (PST) Path: h9ni5339pbe.0!nntp.google.com!news2.google.com!postnews.google.com!k40g2000yqf.googlegroups.com!not-for-mail From: Erich Newsgroups: comp.lang.ada Subject: Re: Convert wide_string to string (as the same byte array) Date: Fri, 24 Feb 2012 14:58:26 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <9b005a0a-989a-4c00-8d8e-6f93fa1cf9e3@kh11g2000pbb.googlegroups.com> NNTP-Posting-Host: 85.242.65.3 Mime-Version: 1.0 X-Trace: posting.google.com 1330124385 28952 127.0.0.1 (24 Feb 2012 22:59:45 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 24 Feb 2012 22:59:45 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: k40g2000yqf.googlegroups.com; posting-host=85.242.65.3; posting-account=nd46uAkAAAB2IU3eJoKQE6q_ACEyvPP_ User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALENKRC X-HTTP-UserAgent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-02-24T14:58:26-08:00 List-Id: > You'll probably want something like this, for each Wide_Character, > where S is the String and WS is the Wide_String: Thanks a lot! Seems to work fine. function To_String (WS : Wide_String) return String is S : String (1 .. WS'Length*2); J : Positive; begin J := 1; for I in WS'Range loop S (J) := Character'Val (Wide_Character'Pos (WS (I)) / 256); S (J + 1) := Character'Val (Wide_Character'Pos (WS (I)) mod 256); J := J + 2; end loop; return S; end To_String; Best, Erich