标签:
1.QString -> char*
#include<QTextCodec>
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); QString str="中国人民"; char* ch; // QByteArray ba = str.toLatin1(); QByteArray ba = str.toLocal8Bit(); ch=ba.data(); qDebug()<<ch;
2. char*-> QString
QString str; char *msg; str = QString::fromLocal8Bit(msg);
标签:
原文地址:http://www.cnblogs.com/ike_li/p/4654682.html