Qt 5.10 How to convert data from Firebird database correctly. In the database, the data is buried in the encoding win1251. Hieroglyphs come into the application.
db.setConnectOptions("ISC_DPB_LC_CTYPE=WIN1251"); does not work.
Qt 5.10 does not work
QTextCodec* codec = QTextCodec::codecForName("utf8"); QTextCodec::setCodecForCStrings(codec);
QString, and when writing any external strings there, they are converted. - ߊߚߤߘQStringcopying it into an external buffer with an associated conversion to Windows-1251. However, I do not know platform-independent ways to do this. - ߊߚߤߘstd::map<QChar, char>. And then run through the characters inQString, match each of them through thatstd::mapand write to the final buffer. True, it is not clear what to do with symbols that are missing in Windows 1251. - ߊߚߤߘ