Results 1 to 3 of 3

Thread: SQLite connection and encoding

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Posts
    15

    Default SQLite connection and encoding

    Hello.

    I'm having some encoding problems when QT SQLite connection ( QSqlDatabase::addDatabase("QSQLITE") ) tries to read data from a SQLite archive.
    I assign a field value from the database into a QString variable:

    Qt Code:
    1. QString str001;
    2. str001 = record.value("title").toString();
    To copy to clipboard, switch view to plain text mode 

    I assume that the field contains a UTF-16 encoding (SQLite3 documentation) and I assume that QT4 processes information as UTF-16 unless I use specific functions. And I'm triyng to compile my program under Windows XP SP3 that uses UCS-2 / UTF-16 for heir standard Unicode encoding.
    But when field information displays on the screen I obtain the "?" code for non-standard chars like accentuated vowels or another specific symbols.
    I have tried to display the information in a label, a text box, a list box, a table, ... But always is the same. If QT display standard QStrings (not from SQLite), the output is encoding correctly.
    Is there any way of finding out what is getting lost in the conversion process? Something that warns about the incorrect codification (in the database, the driver, in my head, ...) or something like that.


    Thanks.
    Last edited by mhbeyle; 2nd December 2009 at 16:07.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.