Page 1 of 1

Edit INI File - Problems with Unicode

Posted: Tue Jul 02, 2013 4:45 am
by CNC
Hi,

After upgrading to IA16, I noticed that for some reason my program does not read the INI-files edited by IA-installer anymore. Reason seems to be that IA converts the INI file to UTF-8 with BOM (http://en.wikipedia.org/wiki/Byte_order_mark) in the beginning of file. Strangely enough, IA does not seem to be able to read such files itself. However, read-problems can be fixed by inserting an empty line in the beginning of file. I guess this has something to do with old Microsoft libraries that do not understand BOM?

So, as a heads up to other users if a fix is not possible:

1. InstallAware 16 outputs INI-files that are UTF-8 even if the original file is ANSI.
2. InstallAware 16 "Edit INI File" -function does not work correctly if the original file is already UTF-8 (with BOM). Fix below.
3. UTF-8 INI file read problems (in any program) can be fixed by inserting an empty line at the beginning of file.

Staff, please try this out and comment.

Re: Edit INI File - Problems with Unicode

Posted: Tue Jul 02, 2013 12:03 pm
by FrancescoT
Dear User,

let me verify it.
Regards

Re: Edit INI File - Problems with Unicode

Posted: Fri Jul 12, 2013 9:51 am
by FrancescoT
Dear CNC,

if you save the ini file using UNICODE encoding instead of utf-8 ... it works fine.

Regards

Re: Edit INI File - Problems with Unicode

Posted: Sun Jul 14, 2013 1:50 am
by CNC
Not quite sure what you mean since UTF-8 is Unicode encoding. But I guess you mean Unicode without Byte Order Mark. Then yes, it works as input. But the output file format is still UTF-8 with BOM.

I have to make a correction to my first post. The problem with BOM only affects the first section in an ini-file (for example [FIRST_SECTION]). That is, if an ini-file has its first section at the very beginning of the file, and if the file has a BOM, then IA will not see the first section at all. We had this same problem with our own software but we fixed it. And I did a workaround in InstallAware by inserting an empty line in the beginning of the ini-file before editing it. So, not a problem for us anymore. But I still think that people need to keep their heads up with unicode files. Problems can occur if the first three bytes in an ini-file are: 0xEF,0xBB,0xBF (=BOM).