null returned for g_locale_to_utf8() for g_file_get_contents()



all that I have written is as below:

#include <glib.h>
gint main( gint argc, gchar **argv )
{
        gchar *full_text;
        g_file_get_contents( "ko.po", &full_text, NULL, NULL );
        printf( "here: %s\n", full_text );
        full_text = g_locale_to_utf8( full_text, -1, NULL, NULL, NULL );
        printf( "there: %s\n", full_text );
}

ko.po is anything you want.
is this case I wanna convert euc-kr(my native) into utf8
to feed xchat 1.9 which in development against gtk2.
gtk2 require each .po as utf-8, not native anymore.

well, those cose works. you can confirm by making ko.po file with some lines of text.

but I failed with _one_ line euc-kr text.
if only one character of euc-kr is included, whole g_convert() seems to fail.

Is this a bug? or my fault to break a kinda rule?



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