Re: Writing Unicode to a GTK TextBuffer
- From: Havoc Pennington <hp redhat com>
- To: Raymond Wan <rwan cs mu oz au>
- Cc: gtk-i18n-list gnome org
- Subject: Re: Writing Unicode to a GTK TextBuffer
- Date: 22 Jun 2001 09:42:22 -0400
Raymond Wan <rwan cs mu oz au> writes:
> 11000010 10101001 = 0xc2 0xa9
char buf[3] = { 0xc2, 0xa9, '\0' }
> I've tried a few things such as using the function
> "g_utf8_get_char"
char buf[7];
int len;
len = g_unichar_to_utf8 (176, buf);
buf[len] = '\0';
> Also, I've found many tables of characters in UTF-16...is there a
> table for me to convert to UTF-8 manually? (That is, if I found that a
> character is 3042 in UTF-16 (Japanese A-character), can I find out what it
> is in UTF-8 so that I can use it in GTK+?).
>
The characters are the same for UTF-8 and UTF-16. The encoding is
different. i.e. "gunichar" is the same for both.
There's g_utf8_to_utf16() and g_ucs4_to_utf16(). ucs4 is simply an
array of gunichar.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]