comp.lang.ada
 help / color / mirror / Atom feed
* Ada and UTF-8
@ 2005-04-27 22:05 skylendar
  2005-04-27 22:52 ` Georg Bauhaus
  2005-04-28  7:31 ` Dmitry A. Kazakov
  0 siblings, 2 replies; 4+ messages in thread
From: skylendar @ 2005-04-27 22:05 UTC (permalink / raw)


An iso8859-1 ascii string can easily be converted into a Wide_String
with the function To_Wide_String().

But I need to retrieve the UTF-8 image of such a Wide_String, and I
don't know how to do that.

Example:

W : Wide_String := To_Wide_String("accented characters ������");

then

S : String := xxx(W);


so that S would contains : "accented characters ééààèè"

Thanx for your help

Christophe



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

* Re: Ada and UTF-8
  2005-04-27 22:05 Ada and UTF-8 skylendar
@ 2005-04-27 22:52 ` Georg Bauhaus
  2005-04-29 20:32   ` skylendar
  2005-04-28  7:31 ` Dmitry A. Kazakov
  1 sibling, 1 reply; 4+ messages in thread
From: Georg Bauhaus @ 2005-04-27 22:52 UTC (permalink / raw)


skylendar wrote:
> An iso8859-1 ascii string can easily be converted into a Wide_String
> with the function To_Wide_String().
> 
> But I need to retrieve the UTF-8 image of such a Wide_String, and I
> don't know how to do that.

This should become available with more recent compilers.
Ada 2005 supports UTF-8 via ISO 10646.
Meanwhile you can find implementations of Wide_String to UTF-8 String
in the GNAT sources, in XML/Ada, and elsewhere.
There is also EAStrings and AdaCL.

Georg 



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

* Re: Ada and UTF-8
  2005-04-27 22:05 Ada and UTF-8 skylendar
  2005-04-27 22:52 ` Georg Bauhaus
@ 2005-04-28  7:31 ` Dmitry A. Kazakov
  1 sibling, 0 replies; 4+ messages in thread
From: Dmitry A. Kazakov @ 2005-04-28  7:31 UTC (permalink / raw)


On 27 Apr 2005 15:05:26 -0700, skylendar wrote:

> An iso8859-1 ascii string can easily be converted into a Wide_String
> with the function To_Wide_String().
> 
> But I need to retrieve the UTF-8 image of such a Wide_String, and I
> don't know how to do that.
> 
> Example:
> 
> W : Wide_String := To_Wide_String("accented characters ������");
> 
> then
> 
> S : String := xxx(W);
>
> so that S would contains : "accented characters ééààèè"

http://www.dmitry-kazakov.de/ada/strings_edit.htm 

with Strings_Edit.UTF8.Handling;
use  Strings_Edit.UTF8.Handling;
...
S : String := To_UTF8 (W);

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



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

* Re: Ada and UTF-8
  2005-04-27 22:52 ` Georg Bauhaus
@ 2005-04-29 20:32   ` skylendar
  0 siblings, 0 replies; 4+ messages in thread
From: skylendar @ 2005-04-29 20:32 UTC (permalink / raw)


> This should become available with more recent compilers.
> Ada 2005 supports UTF-8 via ISO 10646.
> Meanwhile you can find implementations of Wide_String to UTF-8 String
> in the GNAT sources, in XML/Ada, and elsewhere.
> There is also EAStrings and AdaCL.
> 
 So far, I use an internal GNAT conversion routine. But I wanted a
standard way to to this conversion. I'm looking forward to switching
to ada 2005 when available.

Thanx again



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

end of thread, other threads:[~2005-04-29 20:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-27 22:05 Ada and UTF-8 skylendar
2005-04-27 22:52 ` Georg Bauhaus
2005-04-29 20:32   ` skylendar
2005-04-28  7:31 ` Dmitry A. Kazakov

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