From: Chenthill Palanisamy Date: Tue, 9 Mar 2010 07:07:30 +0000 (+0530) Subject: Bug 612121 - IMAPX: No UTF7 folder name encoding applied X-Git-Tag: upstream/3.7.4~3287 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf137de9d0b5298f2d01a7129dea40e5721fd8d1;p=platform%2Fupstream%2Fevolution-data-server.git Bug 612121 - IMAPX: No UTF7 folder name encoding applied --- diff --git a/camel/providers/imapx/camel-imapx-server.c b/camel/providers/imapx/camel-imapx-server.c index 8d666c4..2d5d6f4 100644 --- a/camel/providers/imapx/camel-imapx-server.c +++ b/camel/providers/imapx/camel-imapx-server.c @@ -38,6 +38,7 @@ #include #include +#include #include #include "camel-imapx-utils.h" @@ -490,6 +491,7 @@ imapx_command_addv(CamelIMAPXCommand *ic, const gchar *fmt, va_list ap) CamelDataWrapper *D; CamelSasl *A; gchar buffer[16]; + gchar *fname = NULL, *encoded = NULL; CamelException ex = CAMEL_EXCEPTION_INITIALISER; c(printf("adding command, fmt = '%s'\n", fmt)); @@ -592,9 +594,16 @@ imapx_command_addv(CamelIMAPXCommand *ic, const gchar *fmt, va_list ap) case 'f': /* imap folder name */ s = va_arg(ap, gchar *); c(printf("got folder '%s'\n", s)); - /* FIXME: encode folder name */ - /* FIXME: namespace? */ + fname = camel_imapx_store_summary_full_from_path(((CamelIMAPXStore *)ic->job->folder->parent_store)->summary, s); + if (fname) { + encoded = camel_utf8_utf7(fname); + g_free (fname); + } else + encoded = camel_utf8_utf7 (s); + camel_stream_printf((CamelStream *)ic->mem, "\"%s\"", s?s:""); + + g_free (encoded); break; case 'F': /* IMAP flags set */ f = va_arg(ap, guint32); diff --git a/camel/providers/imapx/camel-imapx-utils.c b/camel/providers/imapx/camel-imapx-utils.c index 3f561db..d93c0b3 100644 --- a/camel/providers/imapx/camel-imapx-utils.c +++ b/camel/providers/imapx/camel-imapx-utils.c @@ -1738,7 +1738,7 @@ imapx_parse_list(CamelIMAPXStream *is, CamelException *ex) camel_imapx_stream_nstring(is, &token, ex); linfo->separator = token?*token:0; camel_imapx_stream_astring(is, &token, ex); - linfo->name = g_strdup((gchar *) token); + linfo->name = camel_utf7_utf8 ((gchar *) token); return linfo; }