Re: help with UTF8




setval=g_locale_to_utf8((gchar*)enckeyval,
                        (gssize)strlen(string1),
                        gs1,gs2,NULL);
As per the API at
http://developer.gimp.org/api/2.0/glib/glib-Character-Set-Conversion.html#g-locale-to-utf8
gs1 and gs2 should be locations where the api can store the number of bytes read and written.
So you should be allocating memory for them. I suggest this:

gsize gs1, gs2;
setval = g_locale_to_utf8((gchar*)enckeyval,(gsize)strlen(string1),&gs1,&gs2,NULL);

One more thing, enckeyval holds the encrypted string, then why is it that you are passing the strlen of string1 ? would both be the same ? Also if enckeyval is
a NULL terminated string, you can as well pass '-1' instead of strlen.

Regards,
Raj




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