C++ (Qt)QTextCodec::setCodecForLocale(QTextCodec::codecForName("CP866"));
C++ (Qt)QTextCodec *RU_Locale = QTextCodec::codecForName("CP1251");
C++ (Qt)fieldVal += QString::fromUtf8((const char *)buf.constData(), rSize);
C++ (Qt)fieldVal += RU_Locale->toUnicode((const char *)buf.constData(), rSize);
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC", connName); db.setConnectOptions("SQL_ATTR_CODEC=Windows-1251");
bool QODBCDriverPrivate::setConnectionOptions(const QString& connOpts){ ... } else if ( opt.toUpper() == QLatin1String("SQL_ATTR_CODEC") ) { m_codec = QTextCodec::codecForName(val.toLatin1()); } else { qWarning() << "QODBCDriver::open: Unknown connection attribute '" << opt << '\''; } ... return true;}