unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] notmuch-reply: Display reply message part using UTF-8.
@ 2009-11-28 11:58 Kan-Ru Chen
  2009-11-28 12:31 ` Kan-Ru Chen
  0 siblings, 1 reply; 3+ messages in thread
From: Kan-Ru Chen @ 2009-11-28 11:58 UTC (permalink / raw)
  To: notmuch

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>
---
 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] notmuch-reply: Display reply message part using UTF-8.
  2009-11-28 11:58 [PATCH] notmuch-reply: Display reply message part using UTF-8 Kan-Ru Chen
@ 2009-11-28 12:31 ` Kan-Ru Chen
  2009-12-04  0:48   ` Carl Worth
  0 siblings, 1 reply; 3+ messages in thread
From: Kan-Ru Chen @ 2009-11-28 12:31 UTC (permalink / raw)
  To: notmuch


Same problem as notmuch-show before. Noticed this when I intend to
reply a Chinese mail...


Cheers,
         Kanru

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] notmuch-reply: Display reply message part using UTF-8.
  2009-11-28 12:31 ` Kan-Ru Chen
@ 2009-12-04  0:48   ` Carl Worth
  0 siblings, 0 replies; 3+ messages in thread
From: Carl Worth @ 2009-12-04  0:48 UTC (permalink / raw)
  To: Kan-Ru Chen, notmuch

[-- Attachment #1: Type: text/plain, Size: 330 bytes --]

On Sat, 28 Nov 2009 19:58:29 +0800, Kan-Ru Chen <kanru@kanru.info> wrote:
> Pass the message through the charset filter so that we can view
> messages wrote in different charset encoding.
...
> Same problem as notmuch-show before. Noticed this when I intend to
> reply a Chinese mail...

Thanks Kanru,

This is pushed now.

-Carl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-12-04  0:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-28 11:58 [PATCH] notmuch-reply: Display reply message part using UTF-8 Kan-Ru Chen
2009-11-28 12:31 ` Kan-Ru Chen
2009-12-04  0:48   ` Carl Worth

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).