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       pango_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 assertion

This is the piece of code that i am executing 

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

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

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

setval=g_locale_to_utf8((gchar*)enckeyval,
                        (gssize)strlen(string1),
                        gs1,gs2,NULL);
gtk_entry_set_text(GTK_ENTRY(Mykeytxt), strkeyval);
        
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]