PDA

View Full Version : read an xml file with Asian characters in QTextEdit



Boris Liao
23rd January 2010, 06:16
hi, I need some help!

I use QTextEdit to read an xml file with some Asian characters. But the characters are not displayed correctly.

QTextStream in(&file);
in.setCodec(QTextCodec::codecForName("GB2312"));
QApplication::setOverrideCursor(Qt::WaitCursor);
setPlainText(in.readAll());
QApplication::restoreOverrideCursor();

Did I use the qtextcodec right? Thanks!

wysota
23rd January 2010, 22:56
Yes but is it the right codec?