* Character set conversion
@ 2005-08-02 7:57 Adaddict
2005-08-02 8:24 ` Adrien Plisson
` (4 more replies)
0 siblings, 5 replies; 8+ messages in thread
From: Adaddict @ 2005-08-02 7:57 UTC (permalink / raw)
Greetings,
I'm looking for an Ada package that could provide me functions to convert
strings from one to another character set, for example from Windows to
MSDOS or to Unicode. Does that even exist? I've been looking everywhere
but haven't found anything.
Any help would be appreciated.
Kind regards.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Character set conversion
2005-08-02 7:57 Character set conversion Adaddict
@ 2005-08-02 8:24 ` Adrien Plisson
2005-08-02 8:46 ` tmoran
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Adrien Plisson @ 2005-08-02 8:24 UTC (permalink / raw)
Adaddict wrote:
> I'm looking for an Ada package that could provide me functions to convert
> strings from one to another character set, for example from Windows to
> MSDOS or to Unicode. Does that even exist? I've been looking everywhere
> but haven't found anything.
every decent XML processor should implement some character set
conversion routines. look at the sources of XML/Ada for example, they
may suit your needs. eventually, grab some ideas from there and roll
your own.
--
rien
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Character set conversion
2005-08-02 7:57 Character set conversion Adaddict
2005-08-02 8:24 ` Adrien Plisson
@ 2005-08-02 8:46 ` tmoran
2005-08-02 9:18 ` Adrien Plisson
2005-08-02 9:45 ` Dmitry A. Kazakov
` (2 subsequent siblings)
4 siblings, 1 reply; 8+ messages in thread
From: tmoran @ 2005-08-02 8:46 UTC (permalink / raw)
> strings from one to another character set,
Ada.Strings.Fixed.Translate
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Character set conversion
2005-08-02 8:46 ` tmoran
@ 2005-08-02 9:18 ` Adrien Plisson
0 siblings, 0 replies; 8+ messages in thread
From: Adrien Plisson @ 2005-08-02 9:18 UTC (permalink / raw)
tmoran@acm.org wrote:
> Ada.Strings.Fixed.Translate
according to ARM95 A.4.3 §70:
"Returns the string S whose length is Source’Length and such that S(I)
is the character to which Mapping maps the corresponding element of
Source, for I in 1..Source’Length."
what happens if one character (but not all characters), represented as
a single byte value in your source character set maps to a multibyte
character (is it called surrogate ?) in your destination character set ?
(sorry, i'm not flaming, i really don't know how to handle this case
using the standard)
--
rien
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Character set conversion
2005-08-02 7:57 Character set conversion Adaddict
2005-08-02 8:24 ` Adrien Plisson
2005-08-02 8:46 ` tmoran
@ 2005-08-02 9:45 ` Dmitry A. Kazakov
2005-08-02 16:17 ` John B. Matthews
2005-08-02 16:47 ` Jeffrey Carter
4 siblings, 0 replies; 8+ messages in thread
From: Dmitry A. Kazakov @ 2005-08-02 9:45 UTC (permalink / raw)
On Tue, 02 Aug 2005 03:57:42 -0400, Adaddict wrote:
> I'm looking for an Ada package that could provide me functions to convert
> strings from one to another character set, for example from Windows to
> MSDOS or to Unicode. Does that even exist? I've been looking everywhere
> but haven't found anything.
It is not clear what you actually need.
Windows Unicode = Wide_Character in Ada. So to convert Latin-1 (=Ada
String) to UCS-2 (=Ada Wide_String) you need just To_Wide_String (from
Ada.Characters.Handling.) [ If UTF-8 encoding is what you are looking for,
see http://www.dmitry-kazakov.de/ada/strings_edit.htm ]
As for MS-DOS character set, what do you mean by that, graphical
characters? I'm not sure if they are present in Unicode. Anyway, as others
have noted, Translate might be useful for you.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Character set conversion
2005-08-02 7:57 Character set conversion Adaddict
` (2 preceding siblings ...)
2005-08-02 9:45 ` Dmitry A. Kazakov
@ 2005-08-02 16:17 ` John B. Matthews
2005-08-02 16:47 ` Jeffrey Carter
4 siblings, 0 replies; 8+ messages in thread
From: John B. Matthews @ 2005-08-02 16:17 UTC (permalink / raw)
In article
<deb1f04734da62ea193e591ae9da7ce1@localhost.talkaboutprogramming.com>,
"Adaddict" <adaddict@hotmail.com> wrote:
> Greetings,
> I'm looking for an Ada package that could provide me functions to convert
> strings from one to another character set, for example from Windows to
> MSDOS or to Unicode. Does that even exist? I've been looking everywhere
> but haven't found anything.
> Any help would be appreciated.
> Kind regards.
Pascal Pignard has worked on this for Mac OS X mappings:
<http://perso.wanadoo.fr/blady/creations.html#ada-text-io>
An English readme is included in the tar file:
<http://perso.wanadoo.fr/blady/telechargements/text-io/text-io.tgz>
If you roll your own, mappings are here:
<http://www.unicode.org/Public/MAPPINGS/VENDORS/>
--
John
jmatthews at wright dot edu
www dot wright dot edu/~john.matthews/
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Character set conversion
2005-08-02 7:57 Character set conversion Adaddict
` (3 preceding siblings ...)
2005-08-02 16:17 ` John B. Matthews
@ 2005-08-02 16:47 ` Jeffrey Carter
2005-08-03 1:07 ` Adaddict
4 siblings, 1 reply; 8+ messages in thread
From: Jeffrey Carter @ 2005-08-02 16:47 UTC (permalink / raw)
Adaddict wrote:
>
> I'm looking for an Ada package that could provide me functions to convert
> strings from one to another character set, for example from Windows to
> MSDOS or to Unicode. Does that even exist? I've been looking everywhere
> but haven't found anything.
I have some functions to convert accented characters between ISO
(Windows) and DOS representations, if that's anything like what you're
looking for.
--
Jeff Carter
"If you don't get the President of the United States on that
phone, ... you're going to have to answer to the Coca-Cola
Company."
Dr. Strangelove
32
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Character set conversion
2005-08-02 16:47 ` Jeffrey Carter
@ 2005-08-03 1:07 ` Adaddict
0 siblings, 0 replies; 8+ messages in thread
From: Adaddict @ 2005-08-03 1:07 UTC (permalink / raw)
First of all, thank you everyone for your fast replies.
Those functions to convert accented characters fit exactly for my current
needs.
If you could provide me those libraries or how to get them I would really
appreciate it.
Again, Thank you.
Regards
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-08-03 1:07 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-02 7:57 Character set conversion Adaddict
2005-08-02 8:24 ` Adrien Plisson
2005-08-02 8:46 ` tmoran
2005-08-02 9:18 ` Adrien Plisson
2005-08-02 9:45 ` Dmitry A. Kazakov
2005-08-02 16:17 ` John B. Matthews
2005-08-02 16:47 ` Jeffrey Carter
2005-08-03 1:07 ` Adaddict
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox