mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2026-01-02 12:07:55 +08:00
fix: unittests sets locale before testing
the convert_with_stringstream seems to be missing a .imbue() call to set the locale independent of the global state. Not setting this, can in some settings lead to errors, see Issue #1366.
This commit is contained in:
committed by
Jesse Beder
parent
bbf8bdb087
commit
a2826e8983
@@ -10,6 +10,7 @@ namespace {
|
|||||||
template <typename T>
|
template <typename T>
|
||||||
static std::string convert_with_stringstream(T v, size_t precision = 0) {
|
static std::string convert_with_stringstream(T v, size_t precision = 0) {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
ss.imbue(std::locale::classic());
|
||||||
if (precision > 0) {
|
if (precision > 0) {
|
||||||
ss << std::setprecision(precision);
|
ss << std::setprecision(precision);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user