Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
4.3.2
-
None
Description
When writing an accented character (i.e. the string "così" to a table created like this:
CREATE TABLE test (data VARCHAR(32) CHARACTER SET ucs2 COLLATE ucs2_bin) DEFAULT CHARSET ucs2
Then reading the data back returns an UTF8 encoded double byte character, and print "così".
With the qsqlmysql driver built against the libmysql.dll from MySQL 4.1, everything works fine.
Workaround: the data returned from MySQL is an UTF8 encoded string, thus QString::fromUtf8() can be used to create the correct string, e.g. QString::fromUtf8(query.value(0).toByteArray().constData()) will return "così".