From a56e70ecfe2ebe6c4c5ea26ba8cd29a4c0d4daf0 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 30 Jun 2009 23:53:24 +0000 Subject: [PATCH] * Repaired the code that decides whether it should not bother converting character sets to UTF-8. Not only was there a logical AND where there should have been a logical OR, but the whole thing was in the wrong place. As a result, it only made that decision some of the time. There may be other bugs in this, but I was unable to find them. --- webcit/msg_renderers.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index d8630588f..5b3a65886 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -837,11 +837,6 @@ void render_MAIL_text_plain(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *F MimeLoadData(Mime); } - /* Boring old 80-column fixed format text gets handled this way... */ - if ((strcasecmp(ChrPtr(Mime->Charset), "us-ascii") == 0) && - (strcasecmp(ChrPtr(Mime->Charset), "UTF-8") == 0)) - ConvertIt = 0; - #ifdef HAVE_ICONV if (ConvertIt) { if (StrLength(Mime->Charset) != 0) @@ -853,6 +848,12 @@ void render_MAIL_text_plain(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *F if (cs == NULL) { ConvertIt = 0; } + else if (!strcasecmp(ChrPtr(cs), "utf-8")) { + ConvertIt = 0; + } + else if (!strcasecmp(ChrPtr(cs), "us-ascii")) { + ConvertIt = 0; + } else { ctdl_iconv_open("UTF-8", ChrPtr(cs), &ic); if (ic == (iconv_t)(-1) ) { @@ -897,7 +898,7 @@ void render_MAIL_text_plain(wc_mime_attachment *Mime, StrBuf *RawData, StrBuf *F for (i = bq; i < bn; i++) StrBufAppendBufPlain(Target, HKEY(""), 0); - if (ConvertIt == 1) { + if (ConvertIt) { StrBufConvert(Line, Line1, &ic); } -- 2.30.2