Results 1 to 3 of 3

Thread: Get Korean string from MYSQL(KUBUNTU)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    9
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Get Korean string from MYSQL(KUBUNTU)

    Hello. I'm newbie on QT.

    I'm sorry for my english.

    I want to display MessageBox that include Korean string(from MYSQL).

    Numeric with Alphabet is well done. Only Korean string is broken display.

    The Code is like it.
    -------------------------------------
    Qt Code:
    1. QSqlQuery *query= new QSqlQuery("select Name from User where id='"+id+"' and password='"+password+"'"); //set query
    2. //Name is Korean String char(12)
    3.  
    4. query->exec();
    5. query->next();
    6.  
    7. QString temp1;
    8. temp1=query->value(0).toString(); [B][I]// this step need not convert encoding????[/I][/B]
    9.  
    10. QByteArray temp=temp1.toLocale8Bit();
    11. char *string=temp.data();
    12. QMessageBox::information(this, "Information", QString::fromUtf8(string), QMessageBox::Ok);
    To copy to clipboard, switch view to plain text mode 
    Last edited by morgana; 4th July 2008 at 23:19.

Similar Threads

  1. Problems with korean symbols in file path
    By Raistlin in forum Qt Programming
    Replies: 5
    Last Post: 6th April 2008, 13:59
  2. Reading from sockets in a multithreaded program
    By KoosKoets in forum Qt Programming
    Replies: 9
    Last Post: 4th April 2007, 20:43
  3. saving a c string of variable length in a shared memory?
    By nass in forum General Programming
    Replies: 4
    Last Post: 3rd January 2007, 14:40

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.