View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0024465||Runner||HTML5||Public||2016-11-01 23:43||2018-08-13 14:12|
|Priority||Low||Severity||C - General||Reproducibility||100%|
|Platform||HTML5||OS||Windows 8||OS Version||8.1|
|Target Version||2.1.4||Fixed in Version||2.1.4|
|Summary||0024465: Functions: ini_write_string() does not escape double quotes - breaks JSON.|
|Description||Doing ini_write_string("a", "b", '1"2')|
and ini_read_string will only read "1".
This means that you cannot store JSON in INI files as-is because it'll only read the data until the first keypair.
|Additional Information||Doing string_replace_all(json_encode(map), '"', "'") is a viable workaround.|
|Tags||No tags attached.|
|1.4 Found In||7.7.1338|
|2.x Runtime Found In|
|2.x Runtime Verified In|
a_bug.gmz (119,438 bytes)
Double quotes are not the only things that need better handling. Square brackets, spaces, equal signs, comments (# and ;) all break INI functions. For years I've seen people advocating the use of ds_*_write() and ds_*_read() functions with INI files, not knowing that their tendency to produce JSON output on HTML5 would kill their save data.
This is the reason why I am a JSON purist on GML who never mixes it with INI. You can count on the inadequacies of INI functions to break it.