1
0
mirror of https://github.com/nlohmann/json.git synced 2025-07-13 20:21:48 +03:00

reset locale (for #272)

This commit is contained in:
Niels
2016-06-28 19:18:23 +02:00
parent 420659f187
commit 7214243d89
3 changed files with 15 additions and 3 deletions

View File

@ -5658,10 +5658,13 @@ class basic_json
// reset width to 0 for subsequent calls to this stream
o.width(0);
// fix locale problems
o.imbue(std::locale(std::locale(), new DecimalSeparator));
auto old_locale = o.imbue(std::locale(std::locale(), new DecimalSeparator));
// do the actual serialization
j.dump(o, pretty_print, static_cast<unsigned int>(indentation));
// reset locale
o.imbue(old_locale);
return o;
}