QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));QString prdId = ui.m_prdIdEdit->text();// std::string str = prdId.toAscii().data();// std::string str = prdId.toStdString();// std::string str = tr(prdId.toStdString().c_str()).toStdString();// std::string str = tr(prdId.toAscii().data()).toStdString();
std::locale loc("russian_russia.1251");std::locale::global(loc);
QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));QString qStr = tr("Лолилол");std::string stdStr = qStr.toStdString();
QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));QString qStr = ("Лолилол");std::string stdStr = qStr.toStdString();
QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));QString qStr = m_edit->text();std::string stdStr = qStr.toStdString();
C++ (Qt)QTextCodec::setCodecForCStrings( QTextCodec::codecForName("Windows-1251") );