cocobelgica / AutoHotkey-JSON

JSON module for AutoHotkey

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

distinction between true/false and 1/0 not preserved

egocarib opened this issue · 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.

(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)

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.

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