MySQL Forums
Forum List  »  MySQL Workbench

Re: UTF-16 on Linux Workbench - how?
Posted by: Al B
Date: June 06, 2014 02:36AM

I think that if Workbench has a bug with displaying UTF-16, then this bug should have many times reported already. Maybe I incorrectly insert the UTF-16 strings? I insert them as follows:

-------

char* szQuery = new char[ qlen ];
memset( szQuery, 0, qlen );
char* qend = szQuery;
char16_t test = {61, 1060};

qend += sprintf( szQuery, "INSERT INTO main (UCS2Field) VALUES('");

qend += mysql_real_escape_string( m_conn, qend, (char*)test, 4 );
*qend++='\'';

-------

In this case the char16's (61, 1040) are stored in database in LE mode:

0x3D 0x00 0x24 0x04

I tried to convert them to BE mode before inserting, but neither variant is displayed correctly. Maybe one need to insert the strings in some other way?

Options: ReplyQuote


Subject
Views
Written By
Posted
1830
June 05, 2014 10:52PM
Re: UTF-16 on Linux Workbench - how?
691
June 06, 2014 02:36AM
667
June 06, 2014 12:53PM


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.