jimpark / unsis

Automatically exported from code.google.com/p/unsis
Other
59 stars 15 forks source link

Wrong modification with UTF-8 (with BOM) INI and WriteINIStr #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an ini-file on disk with a ini-section right at the beginning of the 
file. Save it as UTF-8 with BOM.
2. Create an nsis script which modifies the first ini-section with WriteINIStr.
3. run the nsis-script.

What is the expected output? What do you see instead?
I expect to have a valid ini-file with a ini-section that occurs only once. But 
the section occurs twice.  

What version of the product are you using? On what operating system?
NSIS Version 2.46 on Win XP, Win 7 (32 and 64 Bit)

Please provide any additional information below.
I think the problem is, that nsis reads the ini-file as ASCII and so reads the 
first line with BOM and section thus it is not recognized as the requested 
section-name. Therefor it creates a new section. The problem does not occur if 
the first line is empty!

Original issue reported on code.google.com by patrick....@googlemail.com on 7 Sep 2010 at 11:21

GoogleCodeExporter commented 9 years ago
Please try saving your INI file as UTF16LE instead. This is a Windows API issue.

Original comment by jim%scra...@gtempaccount.com on 10 Jan 2011 at 8:16