g_locale_to_utf8



Hi,

I've a question how to use the return of the g_locale_to_utf8 function.
For example I've this code:

----------------------
gchar *s;
gchar *string;

string = g_strdup ("hallo");

s = g_locale_to_utf8 (string,-1,0,0,0);
g_print ("%s\n", s);
free (string);
-----------------------

Or should I do:

...
s = g_strdup (g_locale_to_utf8 (string,-1,0,0,0));
g_print ("%s\n", s);
free (string);
free (s);

As I think it's the second version, but I'm not sure. Can you help me?

regards
Andreas



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