Encoding problem with C API
Posted by: n0000 n0000
Date: April 10, 2005 08:52AM

Hi guys,

I am having a problem with the encoding. I have a mysql server running and I have two tables defined to use UTF-8 encoding. I can write to the database in chinese and view them from the mysql-query-browser.

When I try to read the data out using C API, the chinese characters are displayed as ???. I am not sure why this is happening. I suppose the output from the mysql server should be in utf8 encoding. Am I right? I try to display them with printf("%s",data), but I got ??? chars. I am using it under Gentoo Linux with 2.6 kernel. The default encoding of system is GB18030. But even if I set the system encoding to zh_CN.UTF-8, it still won't work.

Any idea how to retrieve and display the data correctly? Any help is appreciated. Thank you.

Options: ReplyQuote


Subject
Views
Written By
Posted
Encoding problem with C API
7423
April 10, 2005 08:52AM
6321
April 15, 2005 08:37AM
6056
September 23, 2005 12:47AM
3694
November 27, 2005 12:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.