Results 1 to 2 of 2

Thread: Problem migrate frensh characters from Interbase to Mysql

  1. #1
    Join Date
    Mar 2008
    Posts
    55
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Problem migrate frensh characters from Interbase to Mysql

    Hello everybody, I've written a Qt program which migrate data from an Interbase database to a MySQL database.
    It works fine but I've a problem with frensh characters like (é, è, à , etc).
    Those charcaters are fine in the interbase database, but after executing the select request to have data and I display the data I've selected those characters are displayed as " ? ".
    This my connection function
    Qt Code:
    1. QSqlDatabase db = QSqlDatabase::addDatabase(driver, name);
    2. db.setHostName(host);
    3. db.setDatabaseName(path);
    4. db.setUserName(user);
    5. db.setPassword(pwd);
    6. if(driver == "IBASE")
    7. db.setConnectOptions("ISC_DPB_LC_CTYPE = LATIN1");
    8.  
    9. if(!db.open())
    10. {
    11. qCritical() << "Erreur Ouverture base de données : " << db.lastError().text();
    12. return false;
    13. }
    14. return true;
    To copy to clipboard, switch view to plain text mode 
    .
    Can anyone tel me where I'm wrong and how to do resolve this problem.
    Knowing that I've tried to user QTextCodec like
    Qt Code:
    1. QTextCodec *codec = QTextCodec::codecForName("LATIN1");
    2. qDebug() << codec->toUnicode(q1.value(1).toByteArray());
    To copy to clipboard, switch view to plain text mode 
    but I've always the same result " ? ".
    Many thanks in advance.
    Best Regurads.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem migrate frensh characters from Interbase to Mysql

    It should work out of the box. Just throw away line #7.

Similar Threads

  1. Problem at time compilation in traslation of language
    By thomasjoy in forum Qt Programming
    Replies: 3
    Last Post: 22nd May 2007, 15:18

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.