-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
SAX interface unexpectedly gets locale-altered float representation. #4084
Comments
Can you please share a complete example? |
Done. |
Thanks! |
The error is that we replace To fix this, I need a way to efficiently replace this to |
It took me a while to adjust the CI to run the tests with different locales, but I think the fix is good to go. |
* 🐛 make SAX output locale-independent #4084 * ✅ add test * ✅ add test * ✅ add test * ✅ add test * ✅ add test * ✅ add test * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084 * 🐛 make SAX output locale-independent #4084
* 🐛 make SAX output locale-independent nlohmann#4084 * ✅ add test * ✅ add test * ✅ add test * ✅ add test * ✅ add test * ✅ add test * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084 * 🐛 make SAX output locale-independent nlohmann#4084
Description
I didn't expect (neither from experience, nor from the documentation) that the float string representation would be altered according to the locale when feeded into the SAX parser.
I understand, why it has to be altered internally, but I'd expect the original string in the callback.
Reproduction steps
LC_NUMERIC=de_DE.UTF-8
{ "aFloat": 42.0 }
Expected vs. actual results
Expected: 42.0
Actual: 42,0
Minimal code example
g++-12 -o jsontest -I /path/to/nlohmann_json-src/single_include/ --std=c++20 jsontest.cpp
Error messages
No response
Compiler and operating system
Linux/gcc-12, Windows/MSVC19.35
Library version
3.11.2
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: