RE: Reply all - issue
[notmuch-archives.git] / 9e / 7d43ce03ca1818891f3f7b50d92e53561d7e17
1 Return-Path: <kanru@anar.kanru.info>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id ADBE9431FBC\r
6         for <notmuch@notmuchmail.org>; Sat, 28 Nov 2009 04:29:01 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id FpLD0+jht-g8 for <notmuch@notmuchmail.org>;\r
11         Sat, 28 Nov 2009 04:29:01 -0800 (PST)\r
12 Received: from msr17.hinet.net (msr17.hinet.net [168.95.4.117])\r
13         by olra.theworths.org (Postfix) with ESMTP id 7BC4D431FAE\r
14         for <notmuch@notmuchmail.org>; Sat, 28 Nov 2009 04:29:00 -0800 (PST)\r
15 Received: from anar.kanru.info (61-228-153-136.dynamic.hinet.net\r
16         [61.228.153.136])\r
17         by msr17.hinet.net (8.9.3/8.9.3) with ESMTP id UAA19270\r
18         for <notmuch@notmuchmail.org>; Sat, 28 Nov 2009 20:28:42 +0800 (CST)\r
19 Received: from kanru (uid 1000) (envelope-from kanru@anar.kanru.info) id 8b2\r
20         by anar.kanru.info (DragonFly Mail Agent)\r
21         Sat, 28 Nov 2009 19:58:45 +0800\r
22 From: Kan-Ru Chen <kanru@kanru.info>\r
23 To: notmuch@notmuchmail.org\r
24 Date: Sat, 28 Nov 2009 19:58:29 +0800\r
25 Message-Id: <1259409509-16313-1-git-send-email-kanru@kanru.info>\r
26 X-Mailer: git-send-email 1.6.5.3\r
27 Subject: [notmuch] [PATCH] notmuch-reply: Display reply message part using\r
28         UTF-8.\r
29 X-BeenThere: notmuch@notmuchmail.org\r
30 X-Mailman-Version: 2.1.12\r
31 Precedence: list\r
32 List-Id: "Use and development of the notmuch mail system."\r
33         <notmuch.notmuchmail.org>\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
35         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
37 List-Post: <mailto:notmuch@notmuchmail.org>\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
41 X-List-Received-Date: Sat, 28 Nov 2009 12:29:01 -0000\r
42 \r
43 Pass the message through the charset filter so that we can view\r
44 messages wrote in different charset encoding.\r
45 \r
46 Signed-off-by: Kan-Ru Chen <kanru@kanru.info>\r
47 ---\r
48  notmuch-reply.c |    6 ++++++\r
49  1 files changed, 6 insertions(+), 0 deletions(-)\r
50 \r
51 diff --git a/notmuch-reply.c b/notmuch-reply.c\r
52 index 9ca1236..0cda72d 100644\r
53 --- a/notmuch-reply.c\r
54 +++ b/notmuch-reply.c\r
55 @@ -39,11 +39,17 @@ reply_part_content (GMimeObject *part)\r
56  {\r
57      GMimeStream *stream_stdout = NULL, *stream_filter = NULL;\r
58      GMimeDataWrapper *wrapper;\r
59 +    const char *charset;\r
60  \r
61 +    charset = g_mime_object_get_content_type_parameter (part, "charset");\r
62      stream_stdout = g_mime_stream_file_new (stdout);\r
63      if (stream_stdout) {\r
64         g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE);\r
65         stream_filter = g_mime_stream_filter_new(stream_stdout);\r
66 +        if (charset) {\r
67 +          g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),\r
68 +                                   g_mime_filter_charset_new(charset, "UTF-8"));\r
69 +        }\r
70      }\r
71      g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),\r
72                              g_mime_filter_reply_new(TRUE));\r
73 -- \r
74 1.6.5.3\r
75 \r