comp.lang.ada
 help / color / mirror / Atom feed
From: Martin Krischik <krischik@users.sourceforge.net>
Subject: Re: Filenames in Ada
Date: Thu, 24 Nov 2005 20:05:37 +0100
Date: 2005-11-24T20:05:37+01:00	[thread overview]
Message-ID: <2135054.7OILsdcKq7@linux1.krischik.com> (raw)
In-Reply-To: DfOdncUDM740dBneRVn-tg@megapath.net

Randy Brukardt wrote:

> "Martin Krischik" <krischik@users.sourceforge.net> wrote in message
> news:1653090.31FM62oI6I@linux1.krischik.com...
> ...
>> How does one deal with modern (utf-8) filenames in Ada?
> 
> We talked about this briefly at a recent meeting. We decided it was too
> late to design a proper solution, and virtually all operating systems have
> a way to deal with this anyway. (That is that they take UTF-8 names).
> There's no conceptual problem with putting UTF-8 into a value of type
> String, and as someone else showed, that's typcially supported by Ada
> implementations.

Only Windows wants UTF-16 and extra APIs instead . And that is indeed the
problem I have.

Just a question. I get an NAME_ERROR exception in
Ada.Directories.More_Entries. Is that actually correct? Should the
exception not be in Ada.Directories.Simple_Name?

Only when I convert the name to a string it becomes relevant that it can't
be represented into Latin 1.

See source in

http://cvs.sourceforge.net/viewcvs.py/wikibook-ada/demos/Source/make_m3u.adb?only_with_tag=HEAD&view=markup

> A bigger problem is that Ada (any flavor) has no built-in support for
> UTF-8. I think this is a mistake, but I didn't find much support for
> adding any packages.

Well, that can be rectified with external packages. Text_IO is not as easy
to replace

> It's insane to use Wide_Wide_String to store any 
> significant amount of text, as it would waste nearly 3/4s of the space in
> typical use, so you'd have to use something else (like UTF-8) for storage
> anyway.

Tell the C99 designers. They though that wchar_t should be large enough to
hold all possible values - without defining what "all possible values"
actually is. As it is GNU C defines it as 32 bit.

> Since filenames are implementation-defined anyway, there isn't a whole lot
> of value to standardizing how they're written. So, it's just up to your
> implementer to do something appropriate.

As long as you don't "push them with the nose on it" as we say in Germany:

"An implementation may support Wide_String or Wide_Wide_String variants for
passing filenames if supported by the platform"

they won't do nothing.

Martin
-- 
mailto://krischik@users.sourceforge.net
Ada programming at: http://ada.krischik.com



  parent reply	other threads:[~2005-11-24 19:05 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   ` Martin Krischik [this message]
2005-11-25  6:54     ` Filenames in Ada 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
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