comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@comcast.net>
Subject: Re: Ada, Gnat and Unicode
Date: Thu, 23 Oct 2003 21:54:58 GMT
Date: 2003-10-23T21:54:58+00:00	[thread overview]
Message-ID: <3F984DDD.9040808@comcast.net> (raw)
In-Reply-To: MPG.1a0230a0729e3ce8989778@News.CIS.DFN.DE

Jano wrote:
> Robert I. Eachus dice...

> As you may be seeing now, I want to scan a folder and transform the 
> filenames into UTF8. That's fine for me which know that I'm getting 
> Latin1 encoded strings from the Directory_Operations package, and any 
> metadata entered by the user. But I was wondering what would happen to a 
> Chinese user (not that I foresee any usage of my program in wide 
> deployment, but when faced with the problem one *must* know ;)

Remember my advice about canonicalization.  If you get Unicode or UTF-8 
file names from the OS, they may or may not be in a canonical form.  If 
not, get the OS to do it for you.  And of course, this information is OS 
specific. You won't really care what the OS's definition of canonical 
form is, just whether the strings you are getting are in that form, and 
if not how to call the OS to do that.

>>Look again, in the GNAT Users Guide for "Foreign Language Representation."
>  
> Correct me, that refers to source representation? (I had missed it 
> anyway ^_^)

Yes, it refers to source representation, but if you think about it for a 
second, the source representation of non-Latin1 characters is an issue 
for Character and String literals.  Otherwise the compiler doesn't care 
what Character type you use in your program.

> (Of course if my program were to be translated, that applies. I'm not so 
> concerned about this but I should have been clearer).

-- 
                                                     Robert I. Eachus

"Quality is the Buddha. Quality is scientific reality. Quality is the 
goal of Art. It remains to work these concepts into a practical, 
down-to-earth context, and for this there is nothing more practical or 
down-to-earth than what I have been talking about all along...the repair 
of an old motorcycle."  -- from Zen and the Art of Motorcycle 
Maintenance by Robert Pirsig




  reply	other threads:[~2003-10-23 21:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-23 14:48 Ada, Gnat and Unicode Jano
2003-10-23 15:49 ` Robert I. Eachus
2003-10-23 17:38   ` Jano
2003-10-23 21:54     ` Robert I. Eachus [this message]
2003-10-24 15:09       ` Jano
2003-10-24  4:01 ` Steve
2003-10-24 15:07   ` Jano
replies disabled

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