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

JSON Parsing and I18N, syntax errors on floating point numbers #3191

Closed
lastmikoi opened this issue Sep 22, 2013 · 6 comments

Comments

Projects
None yet
6 participants
@lastmikoi
Copy link

commented Sep 22, 2013

The current JSON parsing is locale-dependent.

That is to say, the parser will interpret numbers as to be internationalized.

Steps to reproduce :

  • Run cataclysm with LC_NUMERIC environment variable set to any language using commas instead of dots for floating point number (such as fr_FR)
  • Enjoy syntax errors on every single floating point value defined in every json files
@yobbobanana

This comment has been minimized.

Copy link
Contributor

commented Sep 22, 2013

Gosh that is unfortunate. I guess that makes the 0.8 version unusable for languages that don't use a compatible decimal format?

I think this should be fixed when i move things over to the new json parser, as it shouldn't have this problem. It does the parsing manually, thus completely ignoring the locale. I think about half of the files have been moved over already, so should be about a week for the rest.

The only way to fix 0.8 would be to explicitly override the LC_NUMERIC setting, i guess.

@i2amroy

This comment has been minimized.

Copy link
Member

commented Sep 24, 2013

Or people can change their localization setting on their computer when they want to play. Since there already is a relatively easy fix for it, it might be better just to focus on fixing it in the experimental.

@uzername

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2013

This issue affects me too. I've closed my bug report.

@goron111

This comment has been minimized.

Copy link
Contributor

commented Sep 28, 2013

we should change the locale on the json stream.

imbue should do what we need
http://www.cplusplus.com/reference/ios/ios/imbue/

@yobbobanana

This comment has been minimized.

Copy link
Contributor

commented Sep 29, 2013

#3279 fixes this for 0.8. It will cease to be an issue when everything is converted over to the new json loader.

@goron111

This comment has been minimized.

Copy link
Contributor

commented Oct 12, 2013

Can be closed

@GlyphGryph GlyphGryph closed this Oct 29, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.