[g-a-devel]Re: Does atk support Unicode?



On Fri, 2002-05-31 at 03:59, Bolian Yin wrote:
> Hello,
> 
> In many atk interface, "char *" is used for string.  Does atk support 
> Unicode?
> If I have a Unicode String,  Can I cast it to (char*) and pass it to 
> atk, such as "atk_object_set_name"?
> or some converstion is need , to UTF8?

The "char *" in ATK is UTF-8, the API documentation indicates that in a
few places (if this information is missing from some places in the ATK
API docs please let me know so I can add it).

Since UTF-8 uses a multibyte encoding based on 8-bit units, you can
safely treat UTF-8 text as null-terminated char* strings.  Of course you
should use UTF-8 routines for parsing, etc, and these are provided in
glib.

So yes, you can pass any UTF-8 string to ATK as a char*, ATK, Pango, and
GNOME consider all "char*" strings to be UTF-8.  If you have some other
encoding such as UCS-2, you must convert it to UTF-8 before passing it
to ATK.

best regards,

Bill

> 
> Thanks,
> bolian
> 
> 





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]