Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E302D431FBC for ; Sun, 22 Nov 2009 00:35:19 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J80-GnrEz40J for ; Sun, 22 Nov 2009 00:35:19 -0800 (PST) Received: from msr12.hinet.net (msr12.hinet.net [168.95.4.112]) by olra.theworths.org (Postfix) with ESMTP id 3CAEF431FAE for ; Sun, 22 Nov 2009 00:35:18 -0800 (PST) Received: from anar.kanru.info (220-132-104-233.HINET-IP.hinet.net [220.132.104.233]) by msr12.hinet.net (8.9.3/8.9.3) with ESMTP id QAA17685 for ; Sun, 22 Nov 2009 16:34:59 +0800 (CST) Received: from kanru (uid 1000) (envelope-from kanru@anar.kanru.info) id 5e3 by anar.kanru.info (DragonFly Mail Agent) Sun, 22 Nov 2009 16:31:21 +0800 From: Kan-Ru Chen To: notmuch@notmuchmail.org Date: Sun, 22 Nov 2009 16:30:47 +0800 Message-Id: <1258878647-16192-1-git-send-email-kanru@kanru.info> X-Mailer: git-send-email 1.6.5.3 Subject: [notmuch] [PATCH] notmuch-show: Show message part using UTF-8. X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Nov 2009 08:35:20 -0000 Pass the message through the charset filter so that we can view messages wrote in different charset encoding. Signed-off-by: Kan-Ru Chen --- 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)); -- 1.6.5.3