Results 1 to 2 of 2

Thread: Qt5 + qdbf encoding problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2011
    Posts
    79
    Thanks
    5
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Qt5 + qdbf encoding problem

    In my program I use qdbf lib to read data from dbf files.
    The dbf files contains data encoded with UTF-8
    So when I run simple test program from http://code.google.com/p/qdbf/ I get my data as abracadabra, like this - "Ð ÑžÐ Â°Ð Â»Ð Â°Ð Ð…Ð Ò Ð Â¶Ð Â°"
    The dbf file in UTF-8, the source cpp file in UTF-8 so I don't understand what I do wrong.

    Windows 7 x32, MinGW 4.8, Qt 5.1, QtCreator 2.7.2

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,017 Times in 4,793 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt5 + qdbf encoding problem

    The test program is written for Qt4. Qt5 may have a slightly changed string handling thus relying on this example is probably not the best idea.

    The string you get is totally screwed up (even length-wise) so it won't help much with detecting the problem. Basically when you have utf-8 data, you should tell QString that the data is utf-8 by using QString::fromUtf8() rather than blindly hoping Qt converts your text by itself.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Problem using the QDbf Library under Windows
    By BlackMath in forum Qt Programming
    Replies: 0
    Last Post: 19th February 2013, 20:38
  2. Encoding problem
    By newb_developer in forum Qt Programming
    Replies: 4
    Last Post: 4th July 2012, 19:03
  3. problem in character encoding
    By fulbay in forum Qt Programming
    Replies: 4
    Last Post: 17th August 2011, 13:29
  4. encoding problem
    By lexqqq in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2010, 23:41
  5. SQLite encoding problem
    By cevou in forum Qt Programming
    Replies: 3
    Last Post: 27th September 2009, 21:37

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
  •  
Qt is a trademark of The Qt Company.