Mantis

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0024465Runner[All Projects] FunctionsPublic2016-11-01 23:432017-10-30 15:18
ReporterYellowAfterlife 
Assigned ToFritz 
PriorityLowSeverityC - GeneralReproducibility100%
StatusAssignedResolutionOpen 
PlatformWindowsOSWindows 8OS Version8.1
Summary0024465: Functions: ini_write_string does not escape double quotes - breaks JSON.
DescriptionDoing ini_write_string("a", "b", '1"2')
will write
[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.
Example attached.
Additional InformationDoing string_replace_all(json_encode(map), '"', "'") is a viable workaround.
1.4 Version7.7.1338
2.x Runtime Version
2.x Runtime Version Verified In
Attached Files? file icon a_bug.gmz [^] (119,438 bytes) 2016-11-01 23:43

- Relationships

-  Notes
(0049996)
GameGeisha (Updater)
2016-11-02 14:16

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.


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker