How to use Visual C++ .Net to save and retrieve Chinese characters?
Posted by: Jason Liu
Date: April 15, 2005 03:01PM

I've been trying to use VC++ .Net to save and retrieve Chinese characters from MySQL 4.1.10, but still can not figure out how.

I have a Chinese string strChinese in my .cpp file, and I saved it using Unicode - code page 1200. When I use AfxMessageBox(strChinese), it displays correctly. But after I save it to a utf8 column in a utf8 table, it is saved as ??? in the database. I am using MySQL Query Browser to look at the data.

I have "charset=utf8" in my connection string, and here is my character_set varialbes,

'character_set_client', 'utf8'
'character_set_connection', 'utf8'
'character_set_database', 'latin1'
'character_set_results', 'utf8'
'character_set_server', 'latin1'
'character_set_system', 'utf8'
'character_sets_dir', '/x/encap/mysql-4.1.10/share/mysql/charsets/'


I've tried different combinations of convert('strChinese' using utf8) and _utf8 introducer, and still can not get it right.

Does anyone know how to solve this problem?

I'm very curious how the MySQL Query Browser works. It works perfectly by itself.

Options: ReplyQuote


Subject
Views
Written By
Posted
How to use Visual C++ .Net to save and retrieve Chinese characters?
3739
April 15, 2005 03:01PM


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.