Always imbue C locale when using istringstream.
This commit is contained in:
parent
b1c2d4b61e
commit
7c6e00798e
@ -67,6 +67,8 @@ importanceHelper::Importance importanceHelper::getImportanceHeader(shared_ptr <c
|
||||
int n = IMPORTANCE_NORMAL;
|
||||
|
||||
std::istringstream iss(value);
|
||||
iss.imbue(std::locale::classic());
|
||||
|
||||
iss >> n;
|
||||
|
||||
Importance i = IMPORTANCE_NORMAL;
|
||||
|
@ -396,6 +396,8 @@ void POP3Connection::authenticateSASL()
|
||||
const string list(x.begin() + 5, x.end());
|
||||
|
||||
std::istringstream iss(list);
|
||||
iss.imbue(std::locale::classic());
|
||||
|
||||
string mech;
|
||||
|
||||
while (iss >> mech)
|
||||
|
@ -144,6 +144,7 @@ void POP3Folder::open(const int mode, bool failIfModeIsNotAvailable)
|
||||
throw exceptions::command_error("STAT", response->getFirstLine());
|
||||
|
||||
std::istringstream iss(response->getText());
|
||||
iss.imbue(std::locale::classic());
|
||||
iss >> m_messageCount;
|
||||
|
||||
if (iss.fail())
|
||||
@ -372,6 +373,7 @@ void POP3Folder::fetchMessages(std::vector <shared_ptr <message> >& msg, const f
|
||||
size_t size = 0;
|
||||
|
||||
std::istringstream iss((*x).second);
|
||||
iss.imbue(std::locale::classic());
|
||||
iss >> size;
|
||||
|
||||
m->m_size = size;
|
||||
@ -456,6 +458,7 @@ void POP3Folder::fetchMessage(shared_ptr <message> msg, const fetchAttributes& o
|
||||
size_t size = 0;
|
||||
|
||||
std::istringstream iss(string(it, responseText.end()));
|
||||
iss.imbue(std::locale::classic());
|
||||
iss >> size;
|
||||
|
||||
dynamicCast <POP3Message>(msg)->m_size = size;
|
||||
@ -677,6 +680,7 @@ shared_ptr <folderStatus> POP3Folder::getStatus()
|
||||
size_t count = 0;
|
||||
|
||||
std::istringstream iss(response->getText());
|
||||
iss.imbue(std::locale::classic());
|
||||
iss >> count;
|
||||
|
||||
shared_ptr <POP3FolderStatus> status = make_shared <POP3FolderStatus>();
|
||||
|
@ -234,7 +234,9 @@ void SMTPConnection::helo()
|
||||
for (size_t i = 1, n = resp->getLineCount() ; i < n ; ++i)
|
||||
{
|
||||
const string line = resp->getLineAt(i).getText();
|
||||
|
||||
std::istringstream iss(line);
|
||||
iss.imbue(std::locale::classic());
|
||||
|
||||
string ext;
|
||||
iss >> ext;
|
||||
|
@ -217,6 +217,7 @@ const SMTPResponse::enhancedStatusCode SMTPResponse::extractEnhancedCode(const s
|
||||
enhancedStatusCode enhCode;
|
||||
|
||||
std::istringstream iss(responseText);
|
||||
iss.imbue(std::locale::classic());
|
||||
|
||||
if (std::isdigit(iss.peek()))
|
||||
{
|
||||
|
@ -79,6 +79,8 @@ void relay::parseImpl
|
||||
std::istringstream iss(string
|
||||
(buffer.begin() + position, buffer.begin() + position + (p - pstart)));
|
||||
|
||||
iss.imbue(std::locale::classic());
|
||||
|
||||
string word;
|
||||
std::vector <string> previous;
|
||||
|
||||
|
@ -256,8 +256,9 @@ void url::parse(const string& str)
|
||||
throw exceptions::malformed_url("Port can only contain digits");
|
||||
|
||||
std::istringstream iss(port);
|
||||
port_t portNum = 0;
|
||||
iss.imbue(std::locale::classic());
|
||||
|
||||
port_t portNum = 0;
|
||||
iss >> portNum;
|
||||
|
||||
if (portNum == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user