MyODBC 3.51.11 and unicode support.

------_=_NextPart_001_01C5AC7B.00362538
Content-Type: text/plain;
charset="koi8-r"
Content-Transfer-Encoding: quoted-printable

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. =9A



Next line tells =9Amysql server that clients would like to use utf-8 for =
sql statement.



pCmdChange->CommandText =3D L"SET NAMES 'utf8'";

pCmdChange->Execute(NULL,NULL,adCmdText);



pCmdChange->CommandText =3D 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')",

=9A=9A=9A=9A=9A=9A=9A=9A=9A=9A=9A '', 'Unicode string UTF-16 as char =
array', '');



pCmdChange->CommandText =3D 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




------_=_NextPart_001_01C5AC7B.00362538--
vos [ Mo, 29 August 2005 11:21 ] [ ID #943252 ]
Datenbanken » gmane.comp.db.mysql.odbc » MyODBC 3.51.11 and unicode support.

Vorheriges Thema: ODBC for Linuc 7.3
Nächstes Thema: table views problem (MySQL, ODBC, OOo)