Re: how to set language for non-unicode text



Sorry. Will just gtk-app-devel-list in future.

Looks like GTK indeed encoded the string in Unicode, although the
original string was not in Unicode.

(gdb) p song_name
$2 = 0x810e300 "¸»Ê¿É½ÏÂ"

(gdb) x/8 0x810e300
0x810e300:      0xbbc2b8c2      0xbfc28ac3      0xbdc289c3      0x82c38fc3
0x810e310:      0x00000000      0x00000011      0x656d614e      0x2e313300

The original string was in GB2312 (4 chinese characters that use 8
bytes).  Looks like GTK+ just treated it as ASCII and converted it
into Unicode (as I didn't tell GTK+ about the original encoding).  I
am trying to find a way to convert the string from GB2312 to UTF8
properly.

thanks.


On Mon, Dec 28, 2009 at 10:56 PM, Dov Grobgeld <dov grobgeld gmail com> wrote:
No, don't use gtk-i18n-list and don't cross post. gtk-app-devel-list is just
fine.

Gtk works only with unicode in utf8 encoding internally, so if you want a
different format on the disk you will have to convert your text on input and
output.

Regards,
Dov

On Mon, Dec 28, 2009 at 19:59, Han <keepsimple gmail com> wrote:

Hi,

I wrote my first linux GUI app using GTK+, which seems to be a very
nice tool.  One question I had is: how can I set the language for
non-unicode text in my application?  I tried to use iconv(), but did
not work out. The iconv_open call returned error ENOENT (2).  Not sure
if i am in the correct direction.

thanks for any help.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





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