aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mail-to-task/mail-to-task.c
diff options
context:
space:
mode:
authorChenthill Palanisamy <pchen@src.gnome.org>2005-12-21 20:38:11 +0800
committerChenthill Palanisamy <pchen@src.gnome.org>2005-12-21 20:38:11 +0800
commitce934e0f6bd56288f13e10099abf7bdbc8bb50e0 (patch)
tree64410f66a1efa374afc87673f6a805a3313247b4 /plugins/mail-to-task/mail-to-task.c
parent752f32f7dbd4d99f159abdd591e164cf00741b0d (diff)
downloadgsoc2013-evolution-ce934e0f6bd56288f13e10099abf7bdbc8bb50e0.tar.gz
gsoc2013-evolution-ce934e0f6bd56288f13e10099abf7bdbc8bb50e0.tar.zst
gsoc2013-evolution-ce934e0f6bd56288f13e10099abf7bdbc8bb50e0.zip
fixes #274433
svn path=/trunk/; revision=30920
Diffstat (limited to 'plugins/mail-to-task/mail-to-task.c')
-rw-r--r--plugins/mail-to-task/mail-to-task.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c
index ba277fc7a8..b22f766811 100644
--- a/plugins/mail-to-task/mail-to-task.c
+++ b/plugins/mail-to-task/mail-to-task.c
@@ -77,7 +77,8 @@ set_description (ECalComponent *comp, CamelMimeMessage *message)
CamelStream *mem;
ECalComponentText text;
GSList sl;
- char *str;
+ char *str, *convert_str = NULL;
+ int bytes_read, bytes_written;
content = camel_medium_get_content_object ((CamelMedium *) message);
if (!content)
@@ -89,7 +90,18 @@ set_description (ECalComponent *comp, CamelMimeMessage *message)
str = g_strndup (((CamelStreamMem *) mem)->buffer->data, ((CamelStreamMem *) mem)->buffer->len);
camel_object_unref (mem);
- text.value = str;
+ /* convert to UTF-8 string */
+ if (str && content->mime_type->params->value)
+ {
+ convert_str = g_convert (str, strlen (str),
+ "UTF-8", content->mime_type->params->value,
+ &bytes_read, &bytes_written, NULL);
+ }
+
+ if (convert_str)
+ text.value = convert_str;
+ else
+ text.value = str;
text.altrep = NULL;
sl.next = NULL;
sl.data = &text;
@@ -97,6 +109,8 @@ set_description (ECalComponent *comp, CamelMimeMessage *message)
e_cal_component_set_description_list (comp, &sl);
g_free (str);
+ if (convert_str)
+ g_free (convert_str);
}
static void