Commit 67744577 authored by Alex Astashyn's avatar Alex Astashyn

Trying to coerce setlocale to make snprintf use commas as delimiter some more

parent d169598c
...@@ -405,9 +405,14 @@ TEST_CASE("regression tests") ...@@ -405,9 +405,14 @@ TEST_CASE("regression tests")
SECTION("issue #379 - locale-independent str-to-num") SECTION("issue #379 - locale-independent str-to-num")
{ {
const std::string orig_locale_name(setlocale(LC_ALL, NULL)); // If I save the locale here and restore it in the end
// of this block, then setLocale(LC_NUMERIC, "de_DE")
// does not actually make snprintf use "," as decimal separator
// on some compilers. I have no idea...
//
//const std::string orig_locale_name(setlocale(LC_ALL, NULL));
setlocale(LC_NUMERIC, "fr_Fr.UTF-8"); setlocale(LC_NUMERIC, "de_DE");
std::array<char, 64> buf; std::array<char, 64> buf;
{ {
...@@ -437,7 +442,7 @@ TEST_CASE("regression tests") ...@@ -437,7 +442,7 @@ TEST_CASE("regression tests")
CHECK(j2.get<double>() == 1.0); CHECK(j2.get<double>() == 1.0);
// restore original locale // restore original locale
setlocale(LC_ALL, orig_locale_name.c_str()); // setlocale(LC_ALL, orig_locale_name.c_str());
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment