PDA

View Full Version : QSettings Codec Problem



yaseminyilmaz
29th November 2012, 07:57
Hi all,

I try to read the values from an ini file using by QSettings. That file includes Turkish characters (İ, ç, ğ, etc). I can’t solve this problem although I’ve used setIniCodec. What can the problem be?



QSettings mSettings("params.ini", QSettings::IniFormat);
mSettings.setIniCodec("ISO 8859-9");
QStringList mAliases = mSettings.value("SerialNumbers/AliasList").toString().split(",");


The content of Ini file:
[SerialNumbers]
AliasList=“TSD,YBS,İAS”

The values of mAliases: TSD, YBS, \460AS

Thanks a lot for your helps and clarification.

yaseminyilmaz
29th November 2012, 15:00
The problem has been solved by using QTextCodec::setCodecForCStrings.