mIRC Homepage

writeini screws up order of INI comments (7.04)

Posted By: bwuser

writeini screws up order of INI comments (7.04) - 30/05/10 10:07 AM

Before calling writeini:

Code:
[Test]
; set this to 0 or 1
test_mode=1

; your name
user_name=cool


After:

Code:
[Test]
test_mode=1
user_name=cool

; set this to 0 or 1
; your name
Posted By: Khaled

Re: writeini screws up order of INI comments (7.04) - 31/05/10 04:05 PM

Thanks this has been fixed for the next version.
Posted By: bwuser

Re: writeini screws up order of INI comments (7.04) - 20/06/10 07:00 PM

Hey Khaled, thanks for the fix!

Two more things for you, dunno how you feel about them:

a) It's still removing empty lines between comments and key/value pairs. Windows' INI routines preserve those.

b) A file saved as ANSI/Windows-1252 will be converted to UTF-8 any time writeini is issued, even if it's on a different section and/or key. Is that intended?

Thanks!
Posted By: Khaled

Re: writeini screws up order of INI comments (7.04) - 20/06/10 09:44 PM

Thanks, I am aware of the empty lines issue, however this was actually one of the problems I had with how Windows handles INI files. In previous versions, most INI files ended up with random numbers of empty lines, or with empty lines removed, after long periods of use. The INI routines in the new version of mIRC will consistently use empty lines where necessary and will remove any extraneous empty lines.

Regarding the encoding issue, this is by design. Since mIRC is now a Unicode application, it will consistently load and save files as UTF-8. This is built-in to the core file routines and applies to all text files.
© 2021 mIRC Discussion Forums