From bcece5dc8099fa6257984ba7fda0ea407b04d377 Mon Sep 17 00:00:00 2001 From: Wilfried Goesgens Date: Fri, 12 Aug 2011 15:49:45 +0000 Subject: [PATCH] display_enter(): handle QP encodings - while loading several headers from the server we need to de-QP, else we will find gibberish in our... - Subject - recipients --- webcit/messages.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/webcit/messages.c b/webcit/messages.c index 0c1c444ad..e809b8ebb 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1403,6 +1403,8 @@ void display_enter(void) if (which == l_subj) { StrBuf *subj = NewStrBuf(); + StrBuf *FlatSubject; + if (!strcasecmp(bstr("replying_mode"), "forward")) { if (strncasecmp(ChrPtr(Line) + 5, "Fw:", 3)) { StrBufAppendBufPlain(subj, HKEY("Fw: "), 0); @@ -1416,7 +1418,10 @@ void display_enter(void) StrBufAppendBufPlain(subj, ChrPtr(Line) + 5, StrLength(Line) - 5, 0); - PutBstr(HKEY("subject"), subj); + FlatSubject = NewStrBufPlain(NULL, StrLength(subj)); + StrBuf_RFC822_to_Utf8(FlatSubject, subj, NULL, NULL); + + PutBstr(HKEY("subject"), FlatSubject); } else if (which == l_wefw) @@ -1441,7 +1446,12 @@ void display_enter(void) } else if (which == l_from) { + StrBuf *FlatFrom; from = NewStrBufPlain(ChrPtr(Line) + 5, StrLength(Line) - 5); + FlatFrom = NewStrBufPlain(NULL, StrLength(from)); + StrBuf_RFC822_to_Utf8(FlatFrom, from, NULL, NULL); + FreeStrBuf(&from); + from = FlatFrom; for (i=0; i