[Tasks] Fix for bug #311482

"simon.zheng" <[email protected]>
Newsgroups gmane.comp.gnome.evolution.patches
Message-ID <1140779450.25533.7.camel@fulltime>
Hi,

Bug 311482 – attachment name in greek language can't be displayed
correctly.

For localized characters, URI is escaped ASCII-encoded like
"file:///home/zheng/%e5%ae%b6%e5%8e%bb.sxw". This string is regards as
valid ASCII string when generating mime part and directly showed to
users. Hence use filename instead of URI.

Sending a patch for review.

Thanks,
-Simon

_______________________________________________
Evolution-patches mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/evolution-patches
evolution-311482-cal-attachment-name.diff (text/x-patch, 1.8 KB)
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.3000
diff -u -p -r1.3000 ChangeLog
--- ChangeLog	24 Feb 2006 02:57:09 -0000	1.3000
+++ ChangeLog	24 Feb 2006 10:49:09 -0000
@@ -1,3 +1,10 @@
+2006-02-24  Simon Zheng  <[email protected]>
+
+	Fixes #311482
+	* gui/dialogs/comp-editor.c: (set_attachment_list): As uri is 
+	encaped ASCII-encoded, it can't be recognized when setting 
+	mime part. Use filename instead of uri.
+
 2006-02-23  Chenthill Palanisamy  <[email protected]>
 
 	Fixes #330677
Index: gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.166
diff -u -p -r1.166 comp-editor.c
--- gui/dialogs/comp-editor.c	10 Feb 2006 22:27:36 -0000	1.166
+++ gui/dialogs/comp-editor.c	24 Feb 2006 10:49:09 -0000
@@ -2297,7 +2297,6 @@ set_attachment_list (CompEditor *editor,
 			camel_data_wrapper_construct_from_stream (wrapper, stream);
 			camel_data_wrapper_set_mime_type (wrapper, "application/octet-stream");
 		}
-		g_free (file_name);
 
 		camel_object_unref (stream);
 		
@@ -2307,12 +2306,14 @@ set_attachment_list (CompEditor *editor,
 	
 		camel_mime_part_set_disposition (part, "attachment");
 
-		char *ptr = strstr (attach_filename, comp_uid);
+		char *ptr = strstr (file_name, comp_uid);
 		if (ptr) {
 			ptr += strlen(comp_uid);
-			if (*ptr++ == '-')
+			if (*ptr++ == '-') {
 				camel_mime_part_set_filename (part, ptr); 
+			}
 		}
+		g_free (file_name);
 
 		e_attachment_bar_attach_mime_part ((EAttachmentBar *) editor->priv->attachment_bar, part);
 		e_expander_set_expanded (E_EXPANDER (editor->priv->attachment_expander), TRUE);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.