comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: Re: Filenames in Ada
Date: Sat, 03 Dec 2005 01:07:10 GMT
Date: 2005-12-03T01:07:10+00:00	[thread overview]
Message-ID: <2d6kf.151732$dP1.509592@newsc.telia.net> (raw)
In-Reply-To: <1839239.KAMAmvIqvL@linux1.krischik.com>

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



  reply	other threads:[~2005-12-03  1:07 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-23 17:36 Filenames in Ada Martin Krischik
2005-11-23 18:09 ` Martin Dowie
2005-11-24 19:16   ` Martin Krischik
2005-11-23 18:59 ` Dmitry A. Kazakov
2005-11-24 19:13   ` Martin Krischik
2005-11-24 20:49     ` Dmitry A. Kazakov
2005-11-24 21:23       ` Larry Kilgallen
2005-11-25  7:12       ` krischik
2005-11-25 12:25         ` [OT] VMS ODS-5 filesystems, was: " Simon Clubley
2005-11-25 18:01           ` Martin Krischik
2005-11-25 18:27             ` Georg Bauhaus
2005-11-25 19:54               ` Martin Krischik
     [not found]             ` <gjqeo157udsnbfuq8ak4dosf6nep5fomss@4ax.com>
2005-11-27  9:31               ` [OT] VMS DCL prompt, was: " Martin Krischik
2005-11-30  0:16                 ` [OT] Administrator accounts (was: VMS DCL prompt) Björn Persson
2005-11-30  4:23                   ` Larry Kilgallen
2005-11-23 22:18 ` Filenames in Ada Randy Brukardt
2005-11-24  3:21   ` Silly question about strings (was: Filenames in Ada) Steve
2005-11-24  4:58     ` Larry Kilgallen
2005-11-24  9:15       ` Martin Dowie
2005-11-24 11:30         ` Silly question about strings Brian May
2005-11-24 13:06         ` Silly question about strings (was: Filenames in Ada) Larry Kilgallen
2005-11-29  3:17     ` Randy Brukardt
2005-11-29  5:53       ` tmoran
2005-11-29 21:48         ` Randy Brukardt
2005-11-30  0:15         ` Björn Persson
2005-11-24 19:05   ` Filenames in Ada Martin Krischik
2005-11-25  6:54     ` Martin Dowie
2005-11-26  1:22 ` Björn Persson
2005-11-27 10:21   ` Martin Krischik
2005-11-30  0:13     ` Björn Persson
2005-12-01  6:59       ` Martin Krischik
2005-12-03  1:07         ` Björn Persson [this message]
2005-12-14  6:59         ` Dave Thompson
2005-12-15 20:23           ` Martin Krischik
2005-12-17  0:22             ` program privileges (was: Filenames in Ada) Georg Bauhaus
2005-12-17 16:59             ` Filenames in Ada Simon Wright
2005-12-17 23:18               ` Larry Kilgallen
2005-12-18 13:30                 ` privileges in Unix and VMS (was: Filenames in Ada) Björn Persson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox