You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting mNumericLocale to false, switches the number parsing from stod to istringstream's operator>>. However, this just switches to a different locale, and does not disable it entirely.
It comes down to stod parsing as per locale set with the C routine setlocale and istringstream - as per locale set with C++ routine std::locale::global. So, the flag does not disable locale, but switches from the locale set in the C world, to the one set in the C++ world. Annoying for all of us, these can be different, not least because calling setlocale does not change std::locale::global
How to reproduce it:
With this patch to test087.cpp:
diff --git a/tests/test087.cpp b/tests/test087.cpp
index 5d8085a..0372b2b 100644
--- a/tests/test087.cpp
+++ b/tests/test087.cpp
@@ -16,6 +16,7 @@ int main()
// ensures that the necessary locale is installed.
return 0;
}
+ std::locale::global(std::locale("de_DE"));
std::string path = unittest::TempPath();
Hi @mejdys - thanks for reporting this and providing a detailed bug report!
I'll look into adding a separate test case and fix for this within the next week. If you need a quick local fix for this I believe something like the following patch would fix it:
Description:
Setting
mNumericLocale
tofalse
, switches the number parsing fromstod
toistringstream
'soperator>>
. However, this just switches to a different locale, and does not disable it entirely.It comes down to
stod
parsing as per locale set with the C routinesetlocale
andistringstream
- as per locale set with C++ routinestd::locale::global
. So, the flag does not disable locale, but switches from the locale set in the C world, to the one set in the C++ world. Annoying for all of us, these can be different, not least because callingsetlocale
does not changestd::locale::global
How to reproduce it:
With this patch to
test087.cpp
:The test will start failing:
Environment:
The text was updated successfully, but these errors were encountered: