Re: mysql_query and UNICODE
Posted by: Pavel Sladky
Date: October 27, 2005 08:02AM

I have such stupid example from C++ 6.0

#if defined _UNICODE
TCHAR ws[256];
char as[256];
char aq[256];

_tcscpy(ws, _T("AB")); // unicode string AB
mysql_real_escape_string(mysql, as, (const char *) ws, _tcslen(ws) * 2); // try to convert to normal chars ????
sprintf(aq, "Insert into ZUPTBL (TBLNAME) VALUES(_utf8 '%s')", as); // create insert query
retval = mysql_query(mysql,aq);

result is that I have only string 'A' in the database.

Any idea how to pass UNICODE strings into DB?



Edited 1 time(s). Last edit at 10/27/2005 08:03AM by Pavel Sladky.

Options: ReplyQuote


Subject
Views
Written By
Posted
6977
October 27, 2005 06:57AM
Re: mysql_query and UNICODE
3531
October 27, 2005 08:02AM


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.