aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/propertySet.cpp4
-rw-r--r--vmime/propertySet.hpp12
2 files changed, 16 insertions, 0 deletions
diff --git a/src/propertySet.cpp b/src/propertySet.cpp
index 88b58f64..efc9659c 100644
--- a/src/propertySet.cpp
+++ b/src/propertySet.cpp
@@ -320,6 +320,8 @@ const bool propertySet::property::getValue() const
int val = 0;
std::istringstream iss(m_value);
+ iss.imbue(std::locale::classic()); // no formatting
+
iss >> val;
return (!iss.fail() && val != 0);
@@ -353,6 +355,8 @@ const bool propertySet::valueFromString(const string& value)
int val = 0;
std::istringstream iss(value);
+ iss.imbue(std::locale::classic()); // no formatting
+
iss >> val;
return (!iss.fail() && val != 0);
diff --git a/vmime/propertySet.hpp b/vmime/propertySet.hpp
index 763177af..542b404f 100644
--- a/vmime/propertySet.hpp
+++ b/vmime/propertySet.hpp
@@ -82,6 +82,8 @@ public:
template <class TYPE> void setValue(const TYPE& value)
{
std::ostringstream oss;
+ oss.imbue(std::locale::classic()); // no formatting
+
oss << value;
m_value = oss.str();
@@ -99,6 +101,8 @@ public:
TYPE val = TYPE();
std::istringstream iss(m_value);
+ iss.imbue(std::locale::classic()); // no formatting
+
iss >> val;
if (iss.fail())
@@ -138,6 +142,8 @@ public:
int val = 0;
std::istringstream iss(m_value);
+ iss.imbue(std::locale::classic()); // no formatting
+
iss >> val;
return (!iss.fail() && val != 0);
@@ -352,6 +358,8 @@ public:
TYPE v = TYPE();
std::istringstream iss(value);
+ iss.imbue(std::locale::classic()); // no formatting
+
iss >> v;
return v;
@@ -361,6 +369,8 @@ public:
static const string valueToString(const TYPE& value)
{
std::ostringstream oss(value);
+ oss.imbue(std::locale::classic()); // no formatting
+
oss << value;
return oss.str();
@@ -390,6 +400,8 @@ public:
int val = 0;
std::istringstream iss(value);
+ iss.imbue(std::locale::classic()); // no formatting
+
iss >> val;
return (!iss.fail() && val != 0);