  | |  | MyODBC 3.51.11 and unicode support. | MyODBC 3.51.11 and unicode support. 2005-08-29 - By Vasiliy O. Stepanov
Back MyODBC 3.51.11 doesn't support Unicode API, but Mysql 4.1 supports Unicode. If you would like to save Unicode strings into Mysql using, you could save your Unicode (UTF-16) as UTF-8. The internal format of mysql for Unicode string is UTF-8. ?
Next line tells ?mysql server that clients would like to use utf-8 for sql statement.
pCmdChange->CommandText = L"SET NAMES 'utf8'";
pCmdChange->Execute(NULL,NULL,adCmdText);
pCmdChange->CommandText = L"SET CHARACTER SET utf8";
pCmdChange->Execute(NULL,NULL,adCmdText);
Save your UTF-16 data into mysql.
sprintf(szBuffer2,"INSERT INTO TempWorkCenter VALUES ('%s', '%s', '%s')",
??????????? '', 'Unicode string UTF-16 as char array', '');
pCmdChange->CommandText = szBuffer2;
pCmdChange->Execute(NULL,NULL,adCmdText);
To query you data from Mysql to the same and use MultiByteToWideChar to convert UTF-8 to UTF-16.
Best regards,
Vasiliy O Stepanov
Earn $52 per hosting referral at Lunarpages.
|
|
 |