]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-reply.c
lib: Treat NULL as a valid (and empty) notmuch_filenames_t iterator.
[notmuch] / notmuch-reply.c
index 9ca1236b9c1791aec6d0ba88ba250e9773cf0689..0cda72dcf05488be170faca9bd9a6e63f6c3e054 100644 (file)
@@ -39,11 +39,17 @@ reply_part_content (GMimeObject *part)
 {
     GMimeStream *stream_stdout = NULL, *stream_filter = NULL;
     GMimeDataWrapper *wrapper;
+    const char *charset;
 
+    charset = g_mime_object_get_content_type_parameter (part, "charset");
     stream_stdout = g_mime_stream_file_new (stdout);
     if (stream_stdout) {
        g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE);
        stream_filter = g_mime_stream_filter_new(stream_stdout);
+        if (charset) {
+          g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),
+                                   g_mime_filter_charset_new(charset, "UTF-8"));
+        }
     }
     g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),
                             g_mime_filter_reply_new(TRUE));