]> granicus.if.org Git - mutt/commitdiff
Fix character set conversion for non-plain text types with 8bit
authorThomas Roessler <roessler@does-not-exist.org>
Sun, 20 May 2001 22:35:29 +0000 (22:35 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Sun, 20 May 2001 22:35:29 +0000 (22:35 +0000)
content-transfer-encodings.  Noted by Björn Jacke.

handler.c

index c41e50b16a13e548b41b386889ce82f94a95e70b..8fcfe5cf4d15c3da2a2999c241f5eeeefc35c4e5 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -238,7 +238,8 @@ void mutt_decode_quoted (STATE *s, long len, int istext, iconv_t cd)
   size_t l2;
   size_t l3;
 
-  state_set_prefix(s);
+  if (istext)
+    state_set_prefix(s);
 
   while (len > 0)
   {
@@ -279,7 +280,8 @@ void mutt_decode_base64 (STATE *s, long len, int istext, iconv_t cd)
 
   buf[4] = 0;
 
-  if (istext) state_set_prefix(s);
+  if (istext) 
+    state_set_prefix(s);
 
   while (len > 0)
   {
@@ -1789,7 +1791,12 @@ void mutt_body_handler (BODY *b, STATE *s)
 
     /* see if we need to decode this part before processing it */
     if (b->encoding == ENCBASE64 || b->encoding == ENCQUOTEDPRINTABLE ||
-       b->encoding == ENCUUENCODED || plaintext)
+       b->encoding == ENCUUENCODED || plaintext || 
+       mutt_is_text_type (b->type, b->subtype))        /* text subtypes may
+                                                        * require character
+                                                        * set conversion even
+                                                        * with 8bit encoding.
+                                                        */
     {
       int origType = b->type;
       char *savePrefix = NULL;