1、
void MainWindow::on_pbtnTest01_clicked() { // http://blog.csdn.net/dbzhang800/article/details/7325698 // http://blog.sina.com.cn/s/blog_bb3b5c230102uxen.html //QTextCodec *codec = QTextCodec::codecForName("GB2312");//或者是GB18030 QTextCodec *codec = QTextCodec::codecForName("GBK"); QString str = codec->toUnicode("退出"); qDebug() << str; ui->pteMsg->appendPlainText(str); str = QString::fromLocal8Bit("退出"); qDebug() << str; ui->pteMsg->appendPlainText(str); ui->pteMsg->appendPlainText("退出"); qDebug() << "退出"; }
2、
3、
4、
5、