Hello Qt users.
I got trouble in convert QString to QByteArray.
I got Korean PlainText from textEdit.
it stored in QString.
So when i print QString the value is correct value.
But QByteArray value from The QString value is incorrect.
What i missed?(OS: Kubuntu(utf8))
QString memo_text
=textEdit.
toPlainText();
qDebug()<<memo_text; //Korean String value correct;
qDebug()<<memo_text; //Korean String value incorrect;
strcpy(memo_info->text , textTemp.data());
qDebug()<<memo_text; //Korean String value incorrect;
QString memo_text=textEdit.toPlainText();
qDebug()<<memo_text; //Korean String value correct;
QByteArray textTemp(memo_text.toUtf8() ,1000);
qDebug()<<memo_text; //Korean String value incorrect;
strcpy(memo_info->text , textTemp.data());
qDebug()<<memo_text; //Korean String value incorrect;
To copy to clipboard, switch view to plain text mode
Bookmarks