Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / f6 / 4d9edc48e8e5293cb1d0bf9f638176b8af025b
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 E302D431FBC\r
6         for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 00:35:19 -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 J80-GnrEz40J for <notmuch@notmuchmail.org>;\r
11         Sun, 22 Nov 2009 00:35:19 -0800 (PST)\r
12 Received: from msr12.hinet.net (msr12.hinet.net [168.95.4.112])\r
13         by olra.theworths.org (Postfix) with ESMTP id 3CAEF431FAE\r
14         for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 00:35:18 -0800 (PST)\r
15 Received: from anar.kanru.info (220-132-104-233.HINET-IP.hinet.net\r
16         [220.132.104.233])\r
17         by msr12.hinet.net (8.9.3/8.9.3) with ESMTP id QAA17685\r
18         for <notmuch@notmuchmail.org>; Sun, 22 Nov 2009 16:34:59 +0800 (CST)\r
19 Received: from kanru (uid 1000) (envelope-from kanru@anar.kanru.info) id 5e3\r
20         by anar.kanru.info (DragonFly Mail Agent)\r
21         Sun, 22 Nov 2009 16:31:21 +0800\r
22 From: Kan-Ru Chen <kanru@kanru.info>\r
23 To: notmuch@notmuchmail.org\r
24 Date: Sun, 22 Nov 2009 16:30:47 +0800\r
25 Message-Id: <1258878647-16192-1-git-send-email-kanru@kanru.info>\r
26 X-Mailer: git-send-email 1.6.5.3\r
27 Subject: [notmuch] [PATCH] notmuch-show: Show message part using UTF-8.\r
28 X-BeenThere: notmuch@notmuchmail.org\r
29 X-Mailman-Version: 2.1.12\r
30 Precedence: list\r
31 List-Id: "Use and development of the notmuch mail system."\r
32         <notmuch.notmuchmail.org>\r
33 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
34         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
35 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
36 List-Post: <mailto:notmuch@notmuchmail.org>\r
37 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
38 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
40 X-List-Received-Date: Sun, 22 Nov 2009 08:35:20 -0000\r
41 \r
42 Pass the message through the charset filter so that we can view\r
43 messages wrote in different charset encoding.\r
44 \r
45 Signed-off-by: Kan-Ru Chen <kanru@kanru.info>\r
46 ---\r
47  notmuch-show.c |    7 +++++++\r
48  1 files changed, 7 insertions(+), 0 deletions(-)\r
49 \r
50 diff --git a/notmuch-show.c b/notmuch-show.c\r
51 index d727f30..c7f1320 100644\r
52 --- a/notmuch-show.c\r
53 +++ b/notmuch-show.c\r
54 @@ -72,12 +72,19 @@ show_part_content (GMimeObject *part)\r
55      GMimeStream *stream_stdout = g_mime_stream_file_new (stdout);\r
56      GMimeStream *stream_filter = NULL;\r
57      GMimeDataWrapper *wrapper;\r
58 +    const char *charset;\r
59 +\r
60 +    charset = g_mime_object_get_content_type_parameter (part, "charset");\r
61  \r
62      if (stream_stdout) {\r
63         g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE);\r
64         stream_filter = g_mime_stream_filter_new(stream_stdout);\r
65         g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),\r
66                                  g_mime_filter_crlf_new(FALSE, FALSE));\r
67 +        if (charset) {\r
68 +          g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter),\r
69 +                                   g_mime_filter_charset_new(charset, "UTF-8"));\r
70 +        }\r
71      }\r
72  \r
73      wrapper = g_mime_part_get_content_object (GMIME_PART (part));\r
74 -- \r
75 1.6.5.3\r
76 \r