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,bde6706c124e6eed X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mail From: =?ISO-8859-15?Q?Bj=F6rn_Persson?= User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Filenames in Ada References: <1653090.31FM62oI6I@linux1.krischik.com> <1255659.7PSTQaQJvX@linux1.krischik.com> <1839239.KAMAmvIqvL@linux1.krischik.com> In-Reply-To: <1839239.KAMAmvIqvL@linux1.krischik.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <2d6kf.151732$dP1.509592@newsc.telia.net> Date: Sat, 03 Dec 2005 01:07:10 GMT NNTP-Posting-Host: 83.250.94.67 X-Complaints-To: abuse@telia.com X-Trace: newsc.telia.net 1133572030 83.250.94.67 (Sat, 03 Dec 2005 02:07:10 CET) NNTP-Posting-Date: Sat, 03 Dec 2005 02:07:10 CET Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:6728 Date: 2005-12-03T01:07:10+00:00 List-Id: Martin Krischik wrote: > Bj�rn Persson wrote: >>Speaking of that, do you know how to find out which code page is active? >>Can I get it from C's nl_langinfo like in Unix? > > Depends. cygwin and mingw do indeed support those functions - but MS-C does > not. I seem to recall that Gnat for Windows uses MinGW, so maybe MinGW's functions are available without installing extra libraries? > Well it usually is some > > pragma Import (C, ....., "_gnat_....."); > > So we have Ada -> C -> libC and we don't only have to replace the Ada > functions but the C functions as well. Yes, that's more work of course. >>Maybe you can do an experiment? Create a file with a surrogate pair in >>the name and see how it's shown in the file manager. You may get boxes >>or something if Windows doesn't have the glyphs, but if you see only one >>box it's obviusly been interpreted as UTF-16. If you see two boxes or >>you get some error then Windows seems to expect UCS-2. > > Anybody got an example? If not I get one from Wikibooks. There is a good > book an "Mandarin Chinese" there which should have enough examples ;-). It doesn't necessarily need to mean anything you know. ;-) Just feed 0061 D800 DC00 0062 to CreateFileW or whatever the function is called, and see if it's shown as "a?b" or "a??b". (The surrogate pair D800 DC00 forms the character U+10000, "Linear B syllable B008 A".) How new is your Windows by the way? > The question is: Which encoding is used for \\?\ Filenames. If it is UTF-8 > it would solve some of our problems. I see. Well it says only the "Unicode versions" of the functions allow that kind of path. That would be the -W functions, which take wide strings, so I would think they expect UTF-16. Either way we still have to come up with a way to call them. -- Bj�rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu