From e9be19e60d982a874dae25c59df9a6b756b8ca7a Mon Sep 17 00:00:00 2001 From: Not Zed Date: Mon, 28 Feb 2005 04:51:26 +0000 Subject: ** See bug #72609 2005-02-24 Not Zed ** See bug #72609 * em-inline-filter.c (emif_scan): try to convert the filename based on the incoming charset or the locale charset. This will make sure it is always valid. svn path=/trunk/; revision=28911 --- mail/ChangeLog | 8 ++++++++ mail/em-inline-filter.c | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index adad67a999..970013c0f8 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2005-02-24 Not Zed + + ** See bug #72609 + + * em-inline-filter.c (emif_scan): try to convert the filename + based on the incoming charset or the locale charset. This will + make sure it is always valid. + 2005-02-28 Not Zed * em-folder-browser.c: reverted Mengjie's patch for 72545. diff --git a/mail/em-inline-filter.c b/mail/em-inline-filter.c index 4b21cee46d..40da981d58 100644 --- a/mail/em-inline-filter.c +++ b/mail/em-inline-filter.c @@ -196,6 +196,7 @@ emif_scan(CamelMimeFilter *f, char *in, size_t len, int final) if (strncmp(start, "begin ", 6) == 0 && start[6] >= '0' && start[6] <= '7') { int i = 7; + char *name; while (start[i] >='0' && start[i] <='7') i++; @@ -206,7 +207,10 @@ emif_scan(CamelMimeFilter *f, char *in, size_t len, int final) break; emif_add_part(emif, data_start, start-data_start); - emif->filename = g_strndup(start+i, inptr-start-i-1); + + name = g_strndup(start+i, inptr-start-i-1); + emif->filename = camel_header_decode_string(name, emif->base_type?camel_content_type_param(emif->base_type, "charset"):NULL); + g_free(name); data_start = start; emif->state = EMIF_UUENC; } else if (strncmp(start, "(This file must be converted with BinHex 4.0)", 45) == 0) { -- cgit