utf8 in CRecordset (visual c++ MFC)
Hello, I can store utf8 characters in my database and see them with MySql Query Browser.
I'm trying to retrieve them from a visual c++ application, using MFC CDatabase and CRecordset.
I changed the CDialog font to "Arial Unicode MS" and I can see the right characters in a messagebox, for example, or in edit boxes.
Here is how I connect to the database:
-------------
m_db.Open(_T("DB"),FALSE, FALSE,_T("ODBC;DSN=DB;DATABASE=db;User Id=db_user; PASSWORD=secret;CHARSET=utf8") );
m_db.ExecuteSQL(_T( "SET NAMES 'utf8'"));
CTestRecordset rs(&m_db);
rs.Open(AFX_DB_USE_DEFAULT_TYPE, _T("SELECT * from table WHERE table.id = 8"));
MessageBox(rs.m_description);
---------
low characters show right (ABcd etc) but chinese or arabic characters appear messed up. Can you help me? :-)
Laura Lucas
Subject
Views
Written By
Posted
utf8 in CRecordset (visual c++ MFC)
3571
July 19, 2005 12:32PM
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.