Edit INI File - Problems with Unicode

Got a problem you cannot solve? Try here.
CNC
Posts: 10
Joined: Tue Jul 02, 2013 3:57 am

Edit INI File - Problems with Unicode

Postby CNC » Tue Jul 02, 2013 4:45 am

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Edit INI File - Problems with Unicode

Postby FrancescoT » Tue Jul 02, 2013 12:03 pm

Dear User,

let me verify it.
Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Edit INI File - Problems with Unicode

Postby FrancescoT » Fri Jul 12, 2013 9:51 am

Dear CNC,

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

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

CNC
Posts: 10
Joined: Tue Jul 02, 2013 3:57 am

Re: Edit INI File - Problems with Unicode

Postby CNC » Sun Jul 14, 2013 1:50 am

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).


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 76 guests