QTextCodec *codec = QTextCodec::codecForName("utf8"); QTextStream out(stdout);out.setCodec(codec); out<<"Привет"<<endl;
QTextCodec *codec = QTextCodec::codecForName("utf8"); QTextCodec::setCodecForTr(codec);QTextStream out(stdout);out.setCodec(codec); out<<QString(QObject::tr("Привет"))<<endl;
char result[128];CharToOemA("Привет", result);cout<<result<<endl;
QString convertStrToUnicode(QString text);#define strMyMsg convertStrToUnicode("Это мое соощение")#define ...
#include <QtGui/QApplication>#include <QTextCodec>#include <QPushButton>int main(int argc, char *argv[]){ QApplication app(argc, argv); QTextCodec *codec = QTextCodec::codecForName("utf8"); QTextCodec::setCodecForTr(codec); QPushButton button(QPushButton::tr("Привет чувак ...")); button.show(); app.connect(&app, SIGNAL(lastWindowClosed()), &app, SLOT(quit())); return app.exec();}
setlocale(LC_CTYPE, "Russian");