AutoHotkey-JSON icon indicating copy to clipboard operation
AutoHotkey-JSON copied to clipboard

distinction between true/false and 1/0 not preserved

Open egocarib opened this issue 6 years ago • 3 comments

The parser consumes true and false but then dumps them as 1 and 0.

This is an issue in JSON strings that include both true/false and 1/0 values that are intended to represent different data types (boolean vs. numeric).

Technically this behavior makes sense if your program is fully insulated in AHK, because AHK stores and represents these values the same way internally, but if you're sharing the JSON file with other applications, the distinction between true/false and 1/0 can become meaningful.

The code change made in response to issue #4 is tangentially related.

egocarib avatar Apr 22 '19 16:04 egocarib

(I can't necessarily think of a way to resolve this issue, so perhaps it cannot be fixed. But I figured it was worth pointing out as it caused me some trouble with a project I'm working on)

egocarib avatar Apr 22 '19 16:04 egocarib

Ran into this myself. Would be nice to have this fixed. I'm very new to AHK but is there way to inject some special metadata into the object that gets created that would indicate the type of the properties? That could then be used to influence how the dump logic works.

mthalman avatar Jun 15 '20 17:06 mthalman

Ran into this myself. Would be nice to have this fixed. I'm very new to AHK but is there way to inject some special metadata into the object that gets created that would indicate the type of the properties? That could then be used to influence how the dump logic works.

https://github.com/G33kDude/AutoHotkey-JSON , this fork fixed it

rlesch avatar Jun 23 '20 00:06 rlesch