C++ (Qt)QTextCodec *codec=QTextCodec::codecForName("windows-1251");QTextCodec::setCodecForCStrings(codec);QTextCodec::setCodecForLocale(codec);QTextCodec::setCodecForTr(codec);
C++ (Qt)int main(int argc, char *argv[]){ QApplication a(argc, argv); QTextCodec *codec=QTextCodec::codecForName("Windows-1251"); QTextCodec::setCodecForCStrings(codec); QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE"); db.setDatabaseName(qApp->applicationDirPath()+QDir::separator()+"database.s3db"); QSqlTableModel model; model.setTable("instr"); model.select(); QTableView view; view.setModel(&model); view.show(); return a.exec(); }