From: Kan-Ru Chen Date: Sun, 22 Nov 2009 08:30:47 +0000 (+0800) Subject: notmuch-show: Show message part using UTF-8. X-Git-Tag: 0.1~365 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=a15f174437ac8be5d75ca95721131cdad011baae notmuch-show: Show message part using UTF-8. Pass the message through the charset filter so that we can view messages wrote in different charset encoding. Signed-off-by: Kan-Ru Chen --- diff --git a/notmuch-show.c b/notmuch-show.c index d727f302..c7f13204 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -72,12 +72,19 @@ show_part_content (GMimeObject *part) GMimeStream *stream_stdout = g_mime_stream_file_new (stdout); GMimeStream *stream_filter = NULL; GMimeDataWrapper *wrapper; + const char *charset; + + charset = g_mime_object_get_content_type_parameter (part, "charset"); if (stream_stdout) { g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE); stream_filter = g_mime_stream_filter_new(stream_stdout); g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter), g_mime_filter_crlf_new(FALSE, FALSE)); + if (charset) { + g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter), + g_mime_filter_charset_new(charset, "UTF-8")); + } } wrapper = g_mime_part_get_content_object (GMIME_PART (part));