PDA

View Full Version : Japanese Text



kroenecker
19th April 2009, 05:33
I'm not seeing Japanese text properly displayed when I compile this simple code. What am I forgetting?



#include <QtGui/QApplication>
#include <QMessageBox>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QMessageBox::critical(0, "わたし", "私", QMessageBox::Cancel);
}

Lykurg
19th April 2009, 07:01
QMessageBox::critical(0, QString::fromUtf8("わたし"), QString::fromUtf8("私"), QMessageBox::Cancel);

Or for internationalizing use trUtf8("xyz").

EDIT: or fromUtf16, don't know wich encoding japanese text has.

kroenecker
19th April 2009, 14:47
Lykurg you rock!