[gtkada] UTF-8 in GtkAda 2.0
Preben Randhol
randhol at pvv.org
Thu Mar 27 11:59:35 CET 2003
Emmanuel Briot <briot at ACT-Europe.FR> wrote on 27/03/2003 (11:41) :
> You are totally confusing the issues here. An Ada string is just that:
> a series of bytes. The signification of the bytes is left to the
> subprogram to which you are passing the string, in this case gtk+.
But if I have a program which accepts input of several different
encodings and I get/set the string from a GEntry widget what is
returned/expected. Is it utf-8 strings?
Second question: With a normal Latin1 (or Latin7 etc...) string : "the
house", I can say noun (5 .. noun'last) to only get "house", but if it
is in utf-8 then I must convert the string from uft-8 to Latin1 (or
Latin7 etc...) before I can do this right? If I split a utf-8 string in
the wrong place they won't make any sense. Have I understood it
correctly?
I need more or less to make a :
type Word_String is
record
String : Unbounded_String;
Encoding : Encoding_Type;
end record;
to keep track of which encoding the string is in?
Third question:
What happens if I have two utf-8 strings an concate them? I mean :
"the " and "house" and you do
noun :string := "the " & "house"
will this always produce a valid utf-8 string or can on risk that is is
invalid?
--
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
«For me, Ada95 puts back the joy in programming.»
More information about the gtkada
mailing list