[Glade-users] help with UTF8



hello folks,

           I am having a strange problem, I am encrypting the a sting
using the tripledes algorithm now when i try to set the encrypted
value obtained to a text entry it gives me error as
WARNING **: Invalid UTF8 string passed to =09pango_layout_set_text()

Now i got to know from somewhere that i need to use the
g_locale_to_utf8() function to convert it to the utf8 string
But my problem is after i do that i get the warning as text entry NULL asse=
rtion

This is the piece of code that i am executing=20

char *string1=3D"helloworld";
GError  *error=3DNULL;
gsize *gs1,*gs2;=20
char *val2;
unsigned char *cipher;
char *enckeyval;
gchar *setval;
GtkWidget *mainwindow,Mykeytxt;

mainwindow =3D lookup_widget (GTK_WIDGET (widget), "mainwindow");
Mykeytxt=3Dlookup_widget(VCTG,"keytxt");

encl_Initialize(DES_3);
enckeyval=3Dencl_EncryptString(string1,cipher,DES_3);//this will return
me the encrypted string

setval=3Dg_locale_to_utf8((gchar*)enckeyval,
=09=09=09(gssize)strlen(string1),
=09=09=09gs1,gs2,NULL);
gtk_entry_set_text(GTK_ENTRY(Mykeytxt), strkeyval);
=09
Where am i going wrong?? I have just initialised the gs1 and gs2 no
values in it ..if i need to initialise the gs1 and gs2 what should it
do with it ??
Please any help is appreciated ...

thanks




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