Encoding problem with C API
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.
Subject
Views
Written By
Posted
Encoding problem with C API
7679
April 10, 2005 08:52AM
3811
April 14, 2005 05:23AM
6432
April 15, 2005 08:37AM
4059
May 07, 2005 08:06AM
6189
September 23, 2005 12:47AM
10609
October 08, 2005 03:20AM
5007
October 15, 2005 10:48AM
3806
November 27, 2005 12:33AM
3924
August 29, 2007 05:28AM
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.