comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Persson" <spam-away@nowhere.nil>
Subject: Re: Filenames in Ada
Date: Sat, 26 Nov 2005 01:22:25 GMT
Date: 2005-11-26T01:22:25+00:00	[thread overview]
Message-ID: <lNOhf.151346$dP1.509079@newsc.telia.net> (raw)
In-Reply-To: <1653090.31FM62oI6I@linux1.krischik.com>

Let's see if I understand the problem. Windows has two functions for 
each file operation, one -A version that expects or returns a file name 
in some 8-bit encoding like Windows-1252, and one -W version that 
expects or returns a file name in UTF-16 or maybe UCS-2? And all the 
file operations in the Ada library take and return file names as String, 
that is, Latin-1? And Gnat's implementation pretends that Latin-1 is 
identical to whatever 8-bit encoding Windows is using, and passes these 
Strings to Windows' -A functions, leaving you with no way to handle 
filenames that can't be expressed in said 8-bit encoding? Is that right?

It is my intention to add an encoding-aware interface to Ada.Directories 
under EAstrings.OS. For that to work reasonably on Windows, this problem 
needs to be solved. I suppose I also need to fix this in EAstrings.IO. I 
will need help from a Windows programmer to do this. (Of course I also 
need to get transcoding implemented on Windows before EAstrings will be 
of any use there.)

It seems that the right thing to do would be to tap into the Gnat 
library and make UTF-16 (or UCS-2) versions of the file operations. It 
could be as easy as changing the parameter type and replacing calls to 
the Windows functions with their -W equivalents, or it could be very hairy.

We'll need to determine whether it is UTF-16 or UCS-2. This page lists 
code page numbers for a whole lot of encodings, but UTF-16 is missing:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/unicode_81rn.asp

I take that as a hint that UTF-16 is Windows' idea of wide strings, and 
that all the others are considered "multi-byte character sets" or 
whatever the term is.

-- 
Bj�rn Persson                              PGP key A88682FD
                    omb jor ers @sv ge.
                    r o.b n.p son eri nu



  parent reply	other threads:[~2005-11-26  1:22 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 [this message]
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
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