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,35e446a9d9a921c8 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!postnews.google.com!y19g2000prb.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Semantics of 'Image and 'Wide_Image on wide enumerations Date: Fri, 3 Dec 2010 12:56:19 -0800 (PST) Organization: http://groups.google.com Message-ID: <3602a004-b50b-42d5-9613-dc4dd522b47d@y19g2000prb.googlegroups.com> References: <70d703e3-816a-4ad2-bf46-99ba9fab209e@z20g2000pra.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1291409779 17641 127.0.0.1 (3 Dec 2010 20:56:19 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 3 Dec 2010 20:56:19 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y19g2000prb.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:15783 Date: 2010-12-03T12:56:19-08:00 List-Id: On Dec 3, 12:25=C2=A0pm, Michael R wrote: > Hi Folks, > > I'm trying to figure out how to get wide enumeration types to generate > wide images of the values and am not getting results I would expect. > Using the simple 'Image, e.g., > > with Ada.Text_IO; > procedure WEnum1 is > =C2=A0 =C2=A0use Ada.Text_IO; > =C2=A0 =C2=A0type Greek is (=CE=B1, =CE=B2, =CE=B3); > begin > =C2=A0 =C2=A0Put_Line ("Alpha is " & Greek'Image (=CE=B1)); > end WEnum > > Gives, (possibly encoded?): > > $ gnatmake -gnat05 -gnatW8 wenum1.adb > gcc -c -gnat05 -gnatW8 wenum1.adb > gnatbind -x wenum1.ali > gnatlink wenum1.ali > $ ./wenum1 > Alpha is =C3=8E=E2=80=98[] > > Using 'Wide_Image gives something more reasonable but not the actual > wide characters: > > with Ada.Wide_Text_IO; > procedure WEnum2 is > =C2=A0 =C2=A0use Ada.Wide_Text_IO; > =C2=A0 =C2=A0type Greek is (=CE=B1, =CE=B2, =CE=B3); > begin > =C2=A0 =C2=A0Put_Line ("Alpha is " & Greek'Wide_Image (=CE=B1)); > end WEnum2; > > $ gnatmake -gnat05 -gnatW8 wenum2.adb > gcc -c -gnat05 -gnatW8 wenum2.adb > gnatbind -x wenum2.ali > gnatlink wenum2.ali > $ ./wenum2 > Alpha is =CE=91 > > Is this the expected behaviour? I think that 'Image, 'Wide_Image, and 'Wide_Wide_Image of enumerations (other than character literals) put the output in upper case, where there is an upper case. So what you're seeing is an upper-case alpha, which looks just like an A. -- Adam