* [PATCH] notmuch-show: Show message part using UTF-8.
@ 2009-11-22 8:30 Kan-Ru Chen
2009-11-22 12:33 ` Carl Worth
0 siblings, 1 reply; 2+ messages in thread
From: Kan-Ru Chen @ 2009-11-22 8:30 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-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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] notmuch-show: Show message part using UTF-8.
2009-11-22 8:30 [PATCH] notmuch-show: Show message part using UTF-8 Kan-Ru Chen
@ 2009-11-22 12:33 ` Carl Worth
0 siblings, 0 replies; 2+ messages in thread
From: Carl Worth @ 2009-11-22 12:33 UTC (permalink / raw)
To: Kan-Ru Chen, notmuch
On Sun, 22 Nov 2009 16:30:47 +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.
Thanks, very much.
We definitely want notmuch to be presenting utf-8 only to the user. And
I didn't realize I'd missed a part of this.
Pushed.
-Carl
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-11-22 12:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-22 8:30 [PATCH] notmuch-show: Show message part using UTF-8 Kan-Ru Chen
2009-11-22 12:33 ` 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).