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,43ab55a75a8b5d1 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!solnet.ch!solnet.ch!zen.net.uk!dedekind.zen.co.uk!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?Q?Bj=F6rn_Persson?= User-Agent: Thunderbird 1.5.0.4 (X11/20060614) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: System.WCh_Cnv References: <3082414.k9Jeq3hKxq@linux1.krischik.com> <1152811469.003475.301520@s13g2000cwa.googlegroups.com> In-Reply-To: <1152811469.003475.301520@s13g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Date: Thu, 13 Jul 2006 21:30:15 GMT NNTP-Posting-Host: 83.250.106.238 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1152826215 83.250.106.238 (Thu, 13 Jul 2006 23:30:15 CEST) NNTP-Posting-Date: Thu, 13 Jul 2006 23:30:15 CEST Organization: Telia Internet Xref: g2news2.google.com comp.lang.ada:5672 Date: 2006-07-13T21:30:15+00:00 List-Id: demoonlit@panathenaia.halfmoon.jp wrote: > Windows comand prompt OK, so your OS is Windows. > So I'd convert JIS character code to other code set(with iconv, > mbstowcs, etc). Do you have Iconv? I thought that wasn't available in Windows. > And other Ada packages assume Wide_String as Unicode. I think it's > natural, because C-functions assume wchar_t as Unicode. > If at all possible, I want take Wide_String as Unicode same as > C-runtime functions. Let's get some things straight so that we'll understand each other better. Unicode defines several character encodings. When you write "Unicode", do you mean UTF-8, UTF-16, UCS-4 (also called UTF-32) or UCS-2? Ada's Wide_String is UCS-2 and Wide_Wide_String is UCS-4. In C it's implementation-defined how wide a wide character is. As far as I know, wchar_t is usually 32 bits in Unix, so that a "wide string" is UCS-4. I hear Microsoft uses 16 bits for wchar_t, but I'm not sure whether a "wide string" in Windows is treated as UCS-2 or UTF-16. > System.WCh_Cnv confound JIS character code with Unicode, it makes > troubles. Wide_Text_IO (and -gnatWs, -gantWe) are useless in fact, > because there is no what uses JIS character code as it is, conversion > is needed after all. I haven't used that package myself so I don't know how it works, but I won't be surprised if it's buggy. In my experience, Adacore's handling of character encodings is rather unimpressive. > So, I want to know why System.WCh_Cnv takes JIS character code? As it's a Gnat-specific package, only Adacore knows why they did it the way they did. You could ask them, but I don't think they'll answer this kind of questions unless you buy a support contract. -- Bj�rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu