QSettings can not handle .ini files with UTF-8 BOM marker at the beginning (0xEF 0xBB 0xBF). For example, when reading file:
the parameters read by QSettings are:
i.e. the first section line is ignored. If I insert a blank line at the beginning of the file:
then QSettings gives the expected result
The problem occurs identically in cases when I call setIniCodec("UTF-8") or do not make the call.
While UTF-8 BOM marker is uncommon and not really useful, some instruments (especially in Windows) create files with it. Well, even Qt Creator supports writing UTF-8 BOM. Ignoring the problem and silently failing is not an option in this case.