Re: gtk_entry_new and accented chars



Hi

I manage to get the latin1 with this code

        p1 = (event->type==GDK_KEY_PRESS)? WM_KEYDOWN : WM_KEYUP;
        p2 = ((GdkEventKey*)event)->keyval;
 uchar= gdk_keyval_to_unicode(((GdkEventKey*)event)->keyval);
 tmpbuf=g_new0(gchar,7);
 g_unichar_to_utf8(uchar,tmpbuf);
 res=g_locale_from_utf8(tmpbuf,-1,NULL,NULL,NULL);

but for accented char i dont get the correct unicode value
for example
for char ä i get this values
(((GdkEventKey*)event)->keyval  = 65506
(((GdkEventKey*)event)->keyval = 65111
(((GdkEventKey*)event)->keyval = 97

some thing like my char is get in pieces, any ideia on how to do this work?

Regards
Luiz





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