diff options
author | Kan-Ru Chen <kanru@kanru.info> | 2009-11-22 16:30:47 +0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-11-22 13:31:34 +0100 |
commit | a15f174437ac8be5d75ca95721131cdad011baae (patch) | |
tree | 9e8d562180a2b9d9b3223fd6984ba6e62e474c0a /notmuch-show.c | |
parent | 7698f4165619688510bd2d98bf3d647680ac8827 (diff) |
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 <kanru@kanru.info>
Diffstat (limited to 'notmuch-show.c')
-rw-r--r-- | notmuch-show.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/notmuch-show.c b/notmuch-show.c index d727f30..c7f1320 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)); |