[gtkada] UTF-8 in GtkAda 2.0

Laurent Guerby guerby at acm.org
Thu Mar 27 12:42:27 CET 2003


On Thu, 2003-03-27 at 10:25, Jacob Sparre Andersen wrote:
> Laurent Guerby wrote:
> 
> > subtype UTF8_String is String;
> > subtype Latin_1_String is String;
> 
> Couldn't I just as well program in C then?

You should try to understand Ada first, here is A.3.27

27    An implementation may provide additional packages as children of
Ada.Characters, to declare names for the symbols of the local character
set or other character sets.
    ***********************     

You'll see that GNAT has Ada.Characters.Latin_1 and
Ada.Characters.Latin_9, hence your interpretation
of String being only Latin_1 is totally bogus. 

What you put in a String is your choice, adding
private types with converters won't give you much
more than simple subtypes in most circonstances
and unless you're coding character set translator software
you'd better follow the convention of your target I/O or UI
package for obvious correctness, performance and space reasons.

-- 
Laurent Guerby <guerby at acm.org>




More information about the gtkada mailing list