diff options
author | Vincent Richard <[email protected]> | 2006-11-17 22:56:27 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2006-11-17 22:56:27 +0000 |
commit | f34baf40b2257ef8857c4293ff1c546594c9d685 (patch) | |
tree | 1424721fb21ba216d3cff1d73d3b9b5aaf3ae000 | |
parent | Fixed typo causing bad line length computation in RFC-2047 Base64 output. (diff) | |
download | vmime-f34baf40b2257ef8857c4293ff1c546594c9d685.tar.gz vmime-f34baf40b2257ef8857c4293ff1c546594c9d685.zip |
Imbue classic 'C' locale for unformatted output.
-rw-r--r-- | src/propertySet.cpp | 4 | ||||
-rw-r--r-- | vmime/propertySet.hpp | 12 |
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); |