-
Notifications
You must be signed in to change notification settings - Fork 7
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
In-Game: json_parse(), json_decode(), string_lower(), string_upper() and other date-to-string functions can give errors when using a locale which uses commas for decimals #5986
Comments
Your original project here and my slightly edited one so I can see the code actually works when there is no error both run absolutely fine for me in Beta IDE v2024.600.0.560 Beta Runtime v2024.600.0.577 and also in 2024.4.1 Monthly. |
I've been unable to replicate the issue on my system using Beta IDE v2024.600.0.560 and Beta Runtime v2024.600.0.577. However, I noticed a potential source of the problem—it seems you are using |
If I then try buffer size+1, I get the number expected error again. |
Btw, I'm getting this issue on 2 PCs, Win 10 and Win 11. Could it have something to do with localization? Full points vs commas? |
Could you check what is the output of the |
The issue also appears when I send the JSON through UDP to this machine, indicating that the issue is while parsing only? |
Could you please attach the json file that is saved by the |
(This is from Dan's project) (If I manually edit it and add apostrophes to the decimals, the error is gone.) |
Hello, Thank you for bringing this issue to our attention. We've identified that the problem was related to the locale settings. To address this, we've made several adjustments to how locales are set within our application:
These changes are expected to enhance the performance of date-to-string conversion functions and resolve the issues with both Notes to QA TeamTesting Requirements:
|
By the way; In-Game: json_parse() has issues with decimals (again) JSON A (full stop): Parsed value in-game: _value == 1.30 JSON B (comma): Parsed value in-game: _value == 1 |
@stravee Which runtime are you using and getting those results? Are you definitely on the latest Beta release? We will double-check here, but as I showed in my comment above and is documented in more detail higher up this issue, json_parse() and json_decode() have definitely had multiple fixes recently to stop that ;) |
we do not support locale specific JSON so the behaviour you are talking about there is NOT supported, we did have a bug early in 2024.6 that meant this was handled but that was a bug and not how it was intended. |
Ahh, yes - now I re-read Francisco's comment above, I see that's what he said at the time and that he clarified only the . decimal is going to work. |
Verified working as per comments with different locale settings as of IDE v2024.600.0.584 Runtime v2024.600.0.608. |
Thanks for pointing out that comment again, I had forgotten about it! For anyone's future reference:
Thanks for your hard work, guys! |
Description
json_parse() seems to have issues while parsing JSON files that have values written as a decimal number:
This used to work fine in at least 2023.11.
Manually editing the file to change those decimals into integers or strings fixes the error.
Steps To Reproduce
-Run the project
-It will save a json file and try to load it immediately after
-The error appears upon trying to parse the loaded file
Which version of GameMaker are you reporting this issue for?
IDE v2024.600.0.560 Runtime v2024.600.0.577
Which operating system(s) are you seeing the problem on?
Windows 10.0.22631.0
Which platform(s) are you seeing the problem on?
Windows
3ddef4ce-96fc-44fd-a878-eff8ff6f6a87
The text was updated successfully, but these errors were encountered: