-
Notifications
You must be signed in to change notification settings - Fork 733
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
parsing float is local dependant #469
Comments
I think you can also define the locale in your code before calling if (std::setlocale(LC_ALL, "C") == NULL) {
std::cerr << "Cannot set locale to C" << std::endl;
} |
is std::setlocale always tread safe? |
The canonical recommendation is to use |
Thank you for answering I suggest using code like https://github.com/michael-hartmann/parsefloat (which can be converted to wide), which not use C or C++ standard library. pugixml can be used on a multithreaded library or code which did not want change locale. |
Fix pugixml float parsing local dependency zeux/pugixml#469 troldal#133 using code from https://github.com/michael-hartmann/parsefloat
Note that some external libraries can change this without the developer noticing, for extra hilarity. If I remember correctly, opening a GTK file dialog did this... |
In France, decimal separator is "," and not "."
strtod used in pugixml.cpp uses strtod which is local dependant
possible alternative:
The text was updated successfully, but these errors were encountered: