Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distinction between true/false and 1/0 not preserved #19

Open
egocarib opened this issue Apr 22, 2019 · 3 comments
Open

distinction between true/false and 1/0 not preserved #19

egocarib opened this issue Apr 22, 2019 · 3 comments

Comments

@egocarib
Copy link

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
Copy link
Author

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

@mthalman
Copy link

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.

@rlesch
Copy link

rlesch commented Jun 23, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants