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 ADBE9431FBC for ; Sat, 28 Nov 2009 04:29:01 -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 FpLD0+jht-g8 for ; Sat, 28 Nov 2009 04:29:01 -0800 (PST) Received: from msr17.hinet.net (msr17.hinet.net [168.95.4.117]) by olra.theworths.org (Postfix) with ESMTP id 7BC4D431FAE for ; Sat, 28 Nov 2009 04:29:00 -0800 (PST) Received: from anar.kanru.info (61-228-153-136.dynamic.hinet.net [61.228.153.136]) by msr17.hinet.net (8.9.3/8.9.3) with ESMTP id UAA19270 for ; Sat, 28 Nov 2009 20:28:42 +0800 (CST) Received: from kanru (uid 1000) (envelope-from kanru@anar.kanru.info) id 8b2 by anar.kanru.info (DragonFly Mail Agent) Sat, 28 Nov 2009 19:58:45 +0800 From: Kan-Ru Chen To: notmuch@notmuchmail.org Date: Sat, 28 Nov 2009 19:58:29 +0800 Message-Id: <1259409509-16313-1-git-send-email-kanru@kanru.info> X-Mailer: git-send-email 1.6.5.3 Subject: [notmuch] [PATCH] notmuch-reply: Display reply 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: Sat, 28 Nov 2009 12:29:01 -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-reply.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/notmuch-reply.c b/notmuch-reply.c index 9ca1236..0cda72d 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -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)); -- 1.6.5.3