mirror of
https://github.com/nlohmann/json.git
synced 2026-04-11 02:28:52 +00:00
reset locale (for #272)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user