C++ (Qt)const char* INI_CODEC_NAME = "windows-1252";...int QAddressBook::loadAddressbook(){ QSettings settings("addressbook.ini",QSettings::IniFormat); settings.setIniCodec(INI_CODEC_NAME); int ContactCount = settings.value("General/ContactCount").toInt(); for (int i = 1; i <= ContactCount; i++) { settings.beginGroup("Contact"+QString::number(i)); currentContact.setName(settings.value("Name").toString()); ... settings.endGroup(); } return 1;}
C++ (Qt) QTextCodec::setCodecForCStrings(QTextCodec::codecForName("Windows-1251")); QTextCodec::setCodecForLocale(QTextCodec::codecForName("Windows-1251")); QTextCodec::setCodecForTr(QTextCodec::codecForName("Windows-1251"));.........// чтение из iniQString str=setting.value("group/paramName").toString();
C++ (Qt) setting.setValue("group/paramName",ui.checkBox->isChecked());
C++ (Qt) QTextCodec *codec = QTextCodec::codecForName(INI_CODEC_NAME); settings.setIniCodec(codec);
C++ (Qt) QTextCodec *tc =QTextCodec::codecForName("Windows-1251"); QTextCodec::setCodecForTr(tc);