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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,347f7cbe27451012 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!news.tiscali.de!newsfeed.freenet.de!newsfeed01.chello.at!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: [ranting] Take Command Plugin, Win32Ada and Ada.Directories Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <3343563.psPA6e9Oqh@linux1.krischik.com> <1pkwbr5s12cf9$.9k2umlcxqzbr.dlg@40tude.net> <473A1241.90702@obry.net> <1vrktz0rlauvu.1nm0xh8n2wl90.dlg@40tude.net> <473ab86d$1@news.post.ch> <473ac065$0$16659$9b4e6d93@newsspool3.arcor-online.net> <473af503$1@news.post.ch> <1195047068.1007.278.camel@kartoffel> <16yvzzr9fekdo.1mb7ng8z7yt49$.dlg@40tude.net> <1195053185.1007.282.camel@kartoffel> <5422260.23vBBKi2sW@linux1.krischik.com> Date: Thu, 15 Nov 2007 09:54:14 +0100 Message-ID: <1vw3m8dqxjoo6$.10mycldk5j8pq.dlg@40tude.net> NNTP-Posting-Date: 15 Nov 2007 09:47:11 CET NNTP-Posting-Host: f4becad1.newsspool2.arcor-online.net X-Trace: DXC=2LJOT=]3JMoPXlQ;h]GTMdA9EHlD;3Ycb4Fo<]lROoRa4nDHegD_]ReVRJ]kaChZVaDNcfSJ;bb[eFCTGGVUmh?dLK[5LiR>kgbSZPYIKTmh0o X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:18409 Date: 2007-11-15T09:47:11+01:00 List-Id: On Wed, 14 Nov 2007 20:32:28 +0100, Martin Krischik wrote: > Dmitry A. Kazakov wrote: > >> On Wed, 14 Nov 2007 16:13:05 +0100, Georg Bauhaus wrote: >> >>> On Wed, 2007-11-14 at 15:36 +0100, Dmitry A. Kazakov wrote: >>>> On Wed, 14 Nov 2007 14:31:08 +0100, Georg Bauhaus wrote: >>>> >>>>> The library API should be easy to call in programs, given >>>>> Interfaces.C.*? >>>> >>>> Except that SetWindowText (Window, "Hello!"); would become about 20-30 >>>> lines long, it is easy to call... >>> >>> Not if there will be an EAStirngs revival for Win32. >>> Your example should then read something like >>> SetWindowText (Window, +"Hello!"); >> >> SetWindowTextW is a function that returns BOOL, instead of raising >> exception. Secondly MultiByteToWideChar is again a function that returns >> naturally not what you call it for. > > I know about MultiByteToWideChar - it's damn ugly indeed. But it is not > needed if you use Wide_Character to start with. No, the point is that this were illegal because Wide_String is UCS-2 [*]. It certainly works for the text "Hello!" (and GNAT on x86), but it would not if the text contained any characters which cannot be represented in UCS-2. So the options are: 1. Wide_Wide_String 2. Wide_String encoded as UTF-16 3. String encoded as UFT-8 or else as UTF-16 The first needs conversions beyond just adding NUL. The last two are just not Ada strings. Among these three evils the third one in UTF-8 is IMO the least one. ----------------------- * Which is also in question, because there is an issue of the endianness of WCHAR vs Wide_Character. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de