Commit de47ca81 authored by Sam Varshavchik's avatar Sam Varshavchik

cone: utf8 maildir update.

parent 1c33c145
......@@ -706,7 +706,6 @@ LIBMAIL_END
//
string mail::mbox::translatePathCommon(string path,
const char *verbotten,
const char *sep)
{
string newpath;
......@@ -807,9 +806,7 @@ string mail::mbox::translatePathCommon(string path,
free(uc);
std::string p(unicode::iconvert::convert(ucvec,
std::string(unicode_x_imap_modutf7 " ")
+ verbotten));
unicode_x_smap_modutf8));
if (newpath.size() > 0)
newpath += sep;
......
......@@ -59,7 +59,7 @@ mail::maildir::folder::folder(mail::maildir *maildirArg,
// (Courier compatibility) to the current charset.
char *s=unicode_convert_tobuf(name.c_str(),
unicode_x_imap_modutf7,
unicode_x_smap_modutf8,
unicode_default_chset(),
NULL);
......@@ -545,7 +545,7 @@ void mail::maildir::folder::createSubFolder(string name, bool isDirectory,
// blacklisted characters:
char *p=unicode_convert_tobuf(name.c_str(), unicode_default_chset(),
unicode_x_imap_modutf7 " ./~:", NULL);
unicode_x_smap_modutf8, NULL);
if (!p)
{
......@@ -631,7 +631,7 @@ bool mail::maildir::maildirmake(string subdir, bool isFolder)
if (!isFolder)
return true;
string f=subdir +
string f=subdir +
"/maildirfolder";
int fd=::open(f.c_str(),
......@@ -731,7 +731,7 @@ void mail::maildir::folder::renameFolder(const mail::folder *newParent,
char *s=unicode_convert_tobuf(newName.c_str(),
unicode_default_chset(),
unicode_x_imap_modutf7 " ./~:", NULL);
unicode_x_smap_modutf8, NULL);
if (!s)
{
......@@ -886,7 +886,7 @@ void mail::maildir::findFolder(string folder,
string mail::maildir::translatePath(string path)
{
return mail::mbox::translatePathCommon(path, ":/.~", ".");
return mail::mbox::translatePathCommon(path, ".");
}
static string encword(string s)
......
......@@ -1522,5 +1522,5 @@ bool mail::mbox::scan(mail::file &scanFile,
string mail::mbox::translatePath(string path)
{
return translatePathCommon(path, "./~:", "/");
return translatePathCommon(path, "/");
}
......@@ -61,7 +61,7 @@ class mbox : public mail::account, public generic {
void reportProgress(size_t bytesCompleted,
size_t bytesEstimatedTotal,
size_t messagesCompleted,
size_t messagesEstimatedTotal) {}
//TODO
......@@ -369,7 +369,6 @@ public:
std::string translatePath(std::string path);
static std::string translatePathCommon(std::string path,
const char *verbotten,
const char *sep);
void readMessageAttributes(const std::vector<size_t> &messages,
......
......@@ -77,7 +77,7 @@ string mail::mbox::folder::defaultName(string path)
path=string(c, e);
char *p=unicode_convert_tobuf(path.c_str(),
unicode_x_imap_modutf7,
unicode_x_smap_modutf8,
unicode_default_chset(),
NULL);
......@@ -451,7 +451,7 @@ void mail::mbox::folder::createSubFolder(string name,
string fpath;
char *p=unicode_convert_tobuf(name.c_str(), unicode_default_chset(),
unicode_x_imap_modutf7 " ./~:", NULL);
unicode_x_smap_modutf8, NULL);
if (!p)
LIBMAIL_THROW("Out of memory.");
......@@ -708,7 +708,7 @@ void mail::mbox::folder::renameFolder(const mail::folder *newParent,
string nameutf7=unicode::iconvert::convert(newName,
unicode_default_chset(),
unicode_x_imap_modutf7 " ./~:");
unicode_x_smap_modutf8);
string newpath=(newParent ? newParent->getPath() + "/":
string("")) + nameutf7;
......
......@@ -667,7 +667,7 @@ string mail::smapHandler::words2path(vector<const char *> &w)
path += "/";
path += unicode::iconvert::convert(*b, "utf-8",
unicode_x_imap_modutf7 " /");
unicode_x_smap_modutf8);
b++;
}
......@@ -693,7 +693,7 @@ void mail::smapHandler::path2words(string path, vector<string> &words)
b++;
words.push_back(unicode::iconvert::convert(component,
unicode_x_imap_modutf7,
unicode_x_smap_modutf8,
"utf-8"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment