morgana
4th July 2008, 17:45
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.
-------------------------------------
QSqlQuery *query= new QSqlQuery("select Name from User where id='"+id+"' and password='"+password+"'"); //set query
//Name is Korean String char(12)
query->exec();
query->next();
QString temp1;
temp1=query->value(0).toString(); // this step need not convert encoding????
QByteArray temp=temp1.toLocale8Bit();
char *string=temp.data();
QMessageBox::information(this, "Information", QString::fromUtf8(string), QMessageBox::Ok);
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.
-------------------------------------
QSqlQuery *query= new QSqlQuery("select Name from User where id='"+id+"' and password='"+password+"'"); //set query
//Name is Korean String char(12)
query->exec();
query->next();
QString temp1;
temp1=query->value(0).toString(); // this step need not convert encoding????
QByteArray temp=temp1.toLocale8Bit();
char *string=temp.data();
QMessageBox::information(this, "Information", QString::fromUtf8(string), QMessageBox::Ok);