* Repaired the code that decides whether it should not bother converting character...
authorArt Cancro <ajc@citadel.org>
Tue, 30 Jun 2009 23:53:24 +0000 (23:53 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 30 Jun 2009 23:53:24 +0000 (23:53 +0000)
webcit/msg_renderers.c

index d8630588fdde7762a8ac0a046cb60886ac1aeb3b..5b3a6588674157e06ed44d886f7bc5b4d14da408 100644 (file)
@@ -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("</blockquote>"), 0);
 
-               if (ConvertIt == 1) {
+               if (ConvertIt) {
                        StrBufConvert(Line, Line1, &ic);
                }