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

Add tests for number parsing with locales that use comma for decimal separator #112

Open
danpla opened this issue Feb 11, 2019 · 0 comments

Comments

@danpla
Copy link

danpla commented Feb 11, 2019

Some JOSN libraries (like the current ccan/json) use locale-dependent C routines like strtod() and snprintf() for reading and writing numbers. In a program that sets a C locale with a comma as the decimal separator (like Russian ru_RU.UTF-8) this will lead to implicit truncation of numbers (strtod() will ignore . and everything after it) and writing broken JSONs (because the numbers in the file will have commas instead of periods).

It would be nice to know which libraries fail to read and write numbers with a locale that use a comma as the decimal separator. If a library doesn't pass this test, others don't actually matter, because the library is useless in practice.

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

1 participant