Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.0.1
-
None
-
Win7, Qt 5.0.1
Description
When we have INI files like this:
foo.ini
<0xEF 0xBB 0xBF>[MainSection] MainKey1=11 MainKey2=22 [SecondSection] SecondSectionKey1=33 SecondSectionKey2=44
When we will try to work with this file in this way:
QSettings confFile(QLatin1String("d:/foo.ini"), QSettings::IniFormat); confFile.setIniCodec(QTextCodec::codecForName("UTF-8")); qDebug() << "groups" << confFile.childGroups(); confFile.beginGroup(QLatin1String("SecondSection")); qDebug() << "keys (for secondary section)" << confFile.childKeys(); confFile.endGroup(); confFile.beginGroup(QLatin1String("MainSection")); qDebug() << "keys (for main section)" << confFile.childKeys(); confFile.endGroup();
we will got this output
groups ("SecondSection")
keys (for secondary section) ("SecondSectionKey1", "SecondSectionKey2")
keys (for main section) ()
But if we will remove BOM mark (in the beginning of file), we will get correct output:
groups ("MainSection", "SecondSection")
keys (for secondary section) ("SecondSectionKey1", "SecondSectionKey2")
keys (for main section) ("MainKey1", "MainKey2")
Attachments
Issue Links
- relates to
-
QTBUG-133804 Qt 5 and Qt 6 both use QtProject.conf, but in an incompatible way
-
- Open
-