aboutsummaryrefslogtreecommitdiffstats
path: root/src/net
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/net/imap/IMAPFolder.cpp20
-rw-r--r--src/net/imap/IMAPMessage.cpp6
-rw-r--r--src/net/imap/IMAPUtils.cpp7
-rw-r--r--src/net/maildir/maildirUtils.cpp1
-rw-r--r--src/net/pop3/POP3Folder.cpp10
5 files changed, 44 insertions, 0 deletions
diff --git a/src/net/imap/IMAPFolder.cpp b/src/net/imap/IMAPFolder.cpp
index 09d33b68..5796528d 100644
--- a/src/net/imap/IMAPFolder.cpp
+++ b/src/net/imap/IMAPFolder.cpp
@@ -821,6 +821,8 @@ void IMAPFolder::deleteMessage(const int num)
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "STORE " << num << " +FLAGS.SILENT (\\Deleted)";
// Send the request
@@ -875,6 +877,8 @@ void IMAPFolder::deleteMessages(const int from, const int to)
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "STORE " << from << ":";
if (to == -1) command << m_messageCount;
@@ -948,6 +952,8 @@ void IMAPFolder::deleteMessages(const std::vector <int>& nums)
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "STORE ";
command << IMAPUtils::listToSet(list, m_messageCount, true);
command << " +FLAGS.SILENT (\\Deleted)";
@@ -1000,6 +1006,7 @@ void IMAPFolder::setMessageFlags(const int from, const int to, const int flags,
throw exceptions::illegal_state("Folder is read-only");
std::ostringstream oss;
+ oss.imbue(std::locale::classic());
if (to == -1)
oss << from << ":*";
@@ -1159,6 +1166,8 @@ void IMAPFolder::setMessageFlags(const string& set, const int flags, const int m
{
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "STORE " << set;
switch (mode)
@@ -1220,6 +1229,8 @@ void IMAPFolder::addMessage(utility::inputStream& is, const int size, const int
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "APPEND " << IMAPUtils::quoteString(IMAPUtils::pathToString
(m_connection->hierarchySeparator(), getFullPath())) << ' ';
@@ -1433,6 +1444,8 @@ void IMAPFolder::rename(const folder::path& newPath)
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "RENAME ";
command << IMAPUtils::quoteString(IMAPUtils::pathToString
(m_connection->hierarchySeparator(), getFullPath())) << " ";
@@ -1506,6 +1519,8 @@ void IMAPFolder::copyMessage(const folder::path& dest, const int num)
// Construct set
std::ostringstream set;
+ set.imbue(std::locale::classic());
+
set << num;
// Delegate message copy
@@ -1544,6 +1559,7 @@ void IMAPFolder::copyMessages(const folder::path& dest, const int from, const in
// Construct set
std::ostringstream set;
+ set.imbue(std::locale::classic());
if (to == -1)
set << from << ":*";
@@ -1614,6 +1630,8 @@ void IMAPFolder::copyMessages(const string& set, const folder::path& dest)
{
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "COPY " << set << " ";
command << IMAPUtils::quoteString(IMAPUtils::pathToString
(m_connection->hierarchySeparator(), dest));
@@ -1642,6 +1660,8 @@ void IMAPFolder::status(int& count, int& unseen)
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "STATUS ";
command << IMAPUtils::quoteString(IMAPUtils::pathToString
(m_connection->hierarchySeparator(), getFullPath()));
diff --git a/src/net/imap/IMAPMessage.cpp b/src/net/imap/IMAPMessage.cpp
index 47e77de4..11c2bea2 100644
--- a/src/net/imap/IMAPMessage.cpp
+++ b/src/net/imap/IMAPMessage.cpp
@@ -409,6 +409,7 @@ void IMAPMessage::extract(ref <const part> p, utility::outputStream& os,
// Construct section identifier
std::ostringstream section;
+ section.imbue(std::locale::classic());
if (p != NULL)
{
@@ -435,6 +436,7 @@ void IMAPMessage::extract(ref <const part> p, utility::outputStream& os,
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
command << "FETCH " << m_num << " BODY";
if (peek) command << ".PEEK";
@@ -545,6 +547,8 @@ void IMAPMessage::processFetchResponse
case IMAPParser::msg_att_item::UID:
{
std::ostringstream oss;
+ oss.imbue(std::locale::classic());
+
oss << folder->m_uidValidity << ":" << (*it)->unique_id()->value();
m_uid = oss.str();
@@ -685,6 +689,8 @@ void IMAPMessage::setFlags(const int flags, const int mode)
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "STORE " << m_num;
switch (mode)
diff --git a/src/net/imap/IMAPUtils.cpp b/src/net/imap/IMAPUtils.cpp
index 6e3c869c..d36bd1eb 100644
--- a/src/net/imap/IMAPUtils.cpp
+++ b/src/net/imap/IMAPUtils.cpp
@@ -390,6 +390,8 @@ const string IMAPUtils::messageFlagList(const int flags)
if (!flagList.empty())
{
std::ostringstream res;
+ res.imbue(std::locale::classic());
+
res << "(";
if (flagList.size() >= 2)
@@ -426,6 +428,8 @@ const string IMAPUtils::listToSet(const std::vector <int>& list, const int max,
// Build the set
std::ostringstream res;
+ res.imbue(std::locale::classic());
+
int previous = -1, setBegin = -1;
for (std::vector <int>::const_iterator it = theList.begin() ;
@@ -483,6 +487,7 @@ const string IMAPUtils::listToSet(const std::vector <int>& list, const int max,
const string IMAPUtils::dateTime(const vmime::datetime& date)
{
std::ostringstream res;
+ res.imbue(std::locale::classic());
// date_time ::= <"> date_day_fixed "-" date_month "-" date_year
// SPACE time SPACE zone <">
@@ -608,6 +613,8 @@ const string IMAPUtils::buildFetchRequest(const std::vector <int>& list, const i
// Build the request text
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "FETCH " << listToSet(list, -1, false) << " (";
for (std::vector <string>::const_iterator it = items.begin() ;
diff --git a/src/net/maildir/maildirUtils.cpp b/src/net/maildir/maildirUtils.cpp
index 004c2553..1f0486b0 100644
--- a/src/net/maildir/maildirUtils.cpp
+++ b/src/net/maildir/maildirUtils.cpp
@@ -203,6 +203,7 @@ const utility::file::path::component maildirUtils::buildFilename
const utility::file::path::component maildirUtils::generateId()
{
std::ostringstream oss;
+ oss.imbue(std::locale::classic());
oss << utility::random::getTime();
oss << ".";
diff --git a/src/net/pop3/POP3Folder.cpp b/src/net/pop3/POP3Folder.cpp
index 7ef4aa12..e19adea0 100644
--- a/src/net/pop3/POP3Folder.cpp
+++ b/src/net/pop3/POP3Folder.cpp
@@ -443,6 +443,8 @@ void POP3Folder::fetchMessage(ref <message> msg, const int options)
{
// Send the "LIST" command
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "LIST " << msg->getNumber();
store->sendRequest(command.str());
@@ -479,6 +481,8 @@ void POP3Folder::fetchMessage(ref <message> msg, const int options)
{
// Send the "UIDL" command
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "UIDL " << msg->getNumber();
store->sendRequest(command.str());
@@ -566,6 +570,8 @@ void POP3Folder::deleteMessage(const int num)
throw exceptions::illegal_state("Folder not open");
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "DELE " << num;
store->sendRequest(command.str());
@@ -615,6 +621,8 @@ void POP3Folder::deleteMessages(const int from, const int to)
for (int i = from ; i <= to2 ; ++i)
{
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "DELE " << i;
store->sendRequest(command.str());
@@ -666,6 +674,8 @@ void POP3Folder::deleteMessages(const std::vector <int>& nums)
it = nums.begin() ; it != nums.end() ; ++it)
{
std::ostringstream command;
+ command.imbue(std::locale::classic());
+
command << "DELE " << (*it);
store->sendRequest(command.str());