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!news2.google.com!proxad.net!proxad.net!newspeer1.se.telia.net!se.telia.net!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mail From: =?ISO-8859-1?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> In-Reply-To: <1653090.31FM62oI6I@linux1.krischik.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: Date: Sat, 26 Nov 2005 01:22:25 GMT NNTP-Posting-Host: 83.250.94.67 X-Complaints-To: abuse@telia.com X-Trace: newsc.telia.net 1132968145 83.250.94.67 (Sat, 26 Nov 2005 02:22:25 CET) NNTP-Posting-Date: Sat, 26 Nov 2005 02:22:25 CET Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:6630 Date: 2005-11-26T01:22:25+00:00 List-Id: 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