Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-1347

MySQL driver does not correctly read from ucs2 tables when built against MySQL 5

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P2: Important P2: Important
    • Some future release
    • 4.3.2
    • SQL Support
    • None

      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ì".

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            bilking Bill King
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes