MantisBT - Doomseeker
View Issue Details
0002742Doomseeker[All Projects] Bugpublic2016-05-27 16:572016-11-12 09:00
rast1234 
Zalewa 
normalminoralways
closednot fixable 
x64Windowsws 1010240
1.0 
 
0002742: Strange escape-characrer in server config
When i save server config and open it in notepad, i see one strange line:

%2Bsv_maxlives=0

Is is supposed to be "+sv_maxlives" but other options are listed without "+" signs in the config. If i remove "%2B" and load config, Doomseeker does not read this value.
1) Open Doomseeker, go to Start server
2) Save config
3) Open the config in notepad
4) Find %2Bsv_maxlives and change its name to sv_maxlives, also change its value, save
5) Open config in Doomseeker
6) Value is not read from config
Also i noticed that first section name in config is "[%General]" but other sections are normal.
No tags attached.
Issue History
2016-05-27 16:57rast1234New Issue
2016-05-27 20:14ZalewaNote Added: 0014988
2016-05-27 20:14ZalewaNote Edited: 0014988bug_revision_view_page.php?bugnote_id=14988#r9042
2016-05-27 20:16ZalewaNote Edited: 0014988bug_revision_view_page.php?bugnote_id=14988#r9043
2016-05-27 20:30rast1234Note Added: 0014989
2016-05-27 22:25ZalewaNote Added: 0014990
2016-11-12 09:00ZalewaNote Added: 0016177
2016-11-12 09:00ZalewaStatusnew => closed
2016-11-12 09:00ZalewaAssigned To => Zalewa
2016-11-12 09:00ZalewaResolutionopen => not fixable

Notes
(0014988)
Zalewa   
2016-05-27 20:14   
(edited on: 2016-05-27 20:16)
This is not a bug but a feature built-in Qt:

'http://doc.qt.io/qt-4.8/qsettings.html#Format-enum [^]'
Quote
The INI file format has severe restrictions on the syntax of a key. Qt works around this by using % as an escape character in keys. In addition, if you save a top-level setting (a key with no slashes in it, e.g., "someKey"), it will appear in the INI file's "General" section. To avoid overwriting other keys, if you save something using the a key such as "General/someKey", the key will be located in the "%General" section, not in the "General" section.


This is absolutely correct and ensures that INI files can be loaded no matter what you type in the input fields.



Look up this page for %2B and you will see that it is an encoded +:
'http://www.w3schools.com/tags/ref_urlencode.asp [^]'

(0014989)
rast1234   
2016-05-27 20:30   
Yes I understand that it is a "+" sign. But there are other options that are used with "+" in command line, but they are stored in .ini without encoded + at their names, that's why I thought it is not normal.
(0014990)
Zalewa   
2016-05-27 22:25   
Still, as long as the program can read the file it creates I see no problem to fix.
(0016177)
Zalewa   
2016-11-12 09:00   
Closing as "not fixable" because that's just how the file format works and how the parser built-in Qt framework writes and reads them.