mIRC Home    About    Download    Register    News    Help

Print Thread
writeini screws up order of INI comments (7.04) #221854 30/05/10 10:07 AM
Joined: Jul 2006
Posts: 248
B
bwuser Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
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

Last edited by bwuser; 30/05/10 10:07 AM.
Re: writeini screws up order of INI comments (7.04) [Re: bwuser] #221903 31/05/10 04:05 PM
Joined: Dec 2002
Posts: 5,004
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,004
Thanks this has been fixed for the next version.

Re: writeini screws up order of INI comments (7.04) [Re: Khaled] #222484 20/06/10 07:00 PM
Joined: Jul 2006
Posts: 248
B
bwuser Offline OP
Fjord artisan
OP Offline
Fjord artisan
B
Joined: Jul 2006
Posts: 248
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!

Re: writeini screws up order of INI comments (7.04) [Re: bwuser] #222491 20/06/10 09:44 PM
Joined: Dec 2002
Posts: 5,004
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,004
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.