visual c++ CRecordset (MFC) and UNICODE utf8 problem
Posted by: laura lucas
Date: July 19, 2005 12:37PM

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. I'm using MyODBC 3.51.12.

Can you help me? :-)

Laura Lucas

Options: ReplyQuote


Subject
Views
Written By
Posted
visual c++ CRecordset (MFC) and UNICODE utf8 problem
2128
July 19, 2005 12:37PM


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.