Re: How to set chinese language??

Tor Lillqvist <[email protected]> Sat, 1 Mar 2003 07:39:19 +0000
Newsgroups gmane.comp.video.gimp.windows.devel
Message-ID <[email protected]>
"HH <[email protected]>" <[email protected]> writes:

 > ifstream file("version.txt"); // it is a chinese document
 >   stringstream tmp;
 >   tmp << file.rdbuf();
 >   string content = tmp.str();
 >   const gchar *pBuffer = content.c_str();  
 > 
 >    gtk_text_buffer_set_text (buffer, g_locale_to_utf8(pBuffer, -1, 
 > NULL, NULL, NULL), -1
 > 
 > It will not properly shown in the buffer , I only can see quadrangles.

What encoding is the file version.txt? Are you sure that
g_locale_to_utf8 is converting it correctly to UTF-8? Please do the
conversion separately and check the return value (and pass in the
GError parameter instead of NULL, to be able to check for errors).

If you have GTK and Pango installed properly, outputting Chinese (or
Arabic, Hebrew, Russian, Devanagari etc) should "just work". 

--tml