comp.lang.ada
 help / color / mirror / Atom feed
* Ada.Directories and UTF-8 encoding ?
@ 2012-12-06 13:37 gautier_niouzes
  2012-12-06 16:53 ` Dmitry A. Kazakov
  2012-12-06 17:56 ` Michael Rohan
  0 siblings, 2 replies; 4+ messages in thread
From: gautier_niouzes @ 2012-12-06 13:37 UTC (permalink / raw)


Hello,
Question: is there a support for UTF-8-encoded file names in Ada.Directories, either mentioned in the RM 2005, 2012, or in some implementations ?
For instance only Copy_File has a Form parameter and on GNAT GPL 2012 it seems to ignore "encoding=utf-8".

For Copy_File, Delete_File ans Rename it doesn't bother me since I plan anyway an own implementation, using Stream_IO where the form "encoding=utf-8" is working, at least on GNAT.

For a directory search using Search it would be nice to have utf-8 working (not tested yet; I'll give a try with the Rosetta code:
http://rosettacode.org/wiki/Walk_a_directory/Recursively#Ada ). 

Cheers
_________________________ 
Gautier's Ada programming 
http://gautiersblog.blogspot.com/search/label/Ada 
NB: follow the above link for a valid e-mail address 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada.Directories and UTF-8 encoding ?
  2012-12-06 13:37 Ada.Directories and UTF-8 encoding ? gautier_niouzes
@ 2012-12-06 16:53 ` Dmitry A. Kazakov
  2012-12-06 17:56 ` Michael Rohan
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry A. Kazakov @ 2012-12-06 16:53 UTC (permalink / raw)


On Thu, 6 Dec 2012 05:37:27 -0800 (PST), gautier_niouzes@hotmail.com wrote:

> Question: is there a support for UTF-8-encoded file names in
> Ada.Directories, either mentioned in the RM 2005, 2012, or in some
> implementations ?

I am using GIO bindings instead of Ada.Directories for this reason.

> For instance only Copy_File has a Form parameter and on GNAT GPL 2012 it
> seems to ignore "encoding=utf-8".

Form is a system-dependent parameter.

> For a directory search using Search it would be nice to have utf-8 working
> (not tested yet; I'll give a try with the Rosetta code:
> http://rosettacode.org/wiki/Walk_a_directory/Recursively#Ada ). 

I don't remember if I tested it for that when I wrote it. It is very
unlikely that Windows implementation uses UTF-8. I guess it is ASCII
(A-calls of Win32 API), which GNAT's implementation of Ada.Directories
makes = it is broken.

You could use GIO bindings, they should work as expected in a
system-independent way. They also support MIME types. See Dir_Open,
Dir_Read_Name, Dir_Close.

http://www.dmitry-kazakov.de/ada/gtkada_contributions.htm#Gtk.Missed.Dir_Open

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada.Directories and UTF-8 encoding ?
  2012-12-06 13:37 Ada.Directories and UTF-8 encoding ? gautier_niouzes
  2012-12-06 16:53 ` Dmitry A. Kazakov
@ 2012-12-06 17:56 ` Michael Rohan
  2012-12-10 23:28   ` Randy Brukardt
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Rohan @ 2012-12-06 17:56 UTC (permalink / raw)


Hi,

I raised this issue a while ago.  Using UTF-8 encoded names appears to work
with the current packages (on my Linux system) but the Ada standard really
needs to be extended to have Wide_ versions of various file, directory,
etc, packages.

Take care,
Michael.

On Thursday, December 6, 2012 5:37:27 AM UTC-8, gautier...@hotmail.com wrote:
> Hello,
> 
> Question: is there a support for UTF-8-encoded file names in Ada.Directories, either mentioned in the RM 2005, 2012, or in some implementations ?
> 
> For instance only Copy_File has a Form parameter and on GNAT GPL 2012 it seems to ignore "encoding=utf-8".
> 
> 
> 
> For Copy_File, Delete_File ans Rename it doesn't bother me since I plan anyway an own implementation, using Stream_IO where the form "encoding=utf-8" is working, at least on GNAT.
> 
> 
> 
> For a directory search using Search it would be nice to have utf-8 working (not tested yet; I'll give a try with the Rosetta code:
> 
> http://rosettacode.org/wiki/Walk_a_directory/Recursively#Ada ). 
> 
> 
> 
> Cheers
> 
> _________________________ 
> 
> Gautier's Ada programming 
> 
> http://gautiersblog.blogspot.com/search/label/Ada 
> 
> NB: follow the above link for a valid e-mail address




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Ada.Directories and UTF-8 encoding ?
  2012-12-06 17:56 ` Michael Rohan
@ 2012-12-10 23:28   ` Randy Brukardt
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Brukardt @ 2012-12-10 23:28 UTC (permalink / raw)


"Michael Rohan" <michael@zanyblue.com> wrote in message 
news:583ae40d-0e99-4e2e-8ce7-4b476cc17561@googlegroups.com...
> Hi,
>
> I raised this issue a while ago.  Using UTF-8 encoded names appears to 
> work
> with the current packages (on my Linux system) but the Ada standard really
> needs to be extended to have Wide_ versions of various file, directory,
> etc, packages.

That way lies madness. We already have packages like Wide_Text_IO, but this 
is orthogonal to those (they're about the type of file, not the type of the 
file names). If we made a Wide_Directories that supported wide file names, 
you'd have to use various combinations of xxx_Directories and xxx_Text_IO 
depending on what you want to do. Hardly anyone could figure it out. 
Besides, the current mechanisms for handling UTF-8 aren't type-safe.

A better solution would be to require some sort of UTF-8 support, but that 
would actually break the support that already works for free on Linux. Thus 
it got a lot of opposition and we decided that it was too late to do 
anything about this for Ada 2012.

I think we will have to obsolsce the entire set of String types and routines 
and replace them with something truly general. (Dmitry has been pointing the 
way.) But whether we'll have the will to do that, I cannot say.

In any case, we have an Amendment AI on this topic, but of course when it 
will be addressed could be a long ways off. (We're not planning to "approve" 
any Amendments until we are given an official charge to do a revision, and 
that's unlikely for the next few years.)

                                             Randy.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-12-10 23:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-06 13:37 Ada.Directories and UTF-8 encoding ? gautier_niouzes
2012-12-06 16:53 ` Dmitry A. Kazakov
2012-12-06 17:56 ` Michael Rohan
2012-12-10 23:28   ` Randy Brukardt

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