]> granicus.if.org Git - mutt/commitdiff
Fix default character set setting when attaching text files.
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 12 Apr 1999 17:34:10 +0000 (17:34 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 12 Apr 1999 17:34:10 +0000 (17:34 +0000)
compose.c
sendlib.c

index 7d6b045fae2bad1c6aa1c9764cf9e921b5e10bc9..00751f1caefa6d4a894f60cebd5355983a96f06d 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -667,6 +667,7 @@ int mutt_compose_menu (HEADER *msg,   /* structure for new message */
            break;
          }
        }
+
         {
          int numtag = 0;
 
index b5c61a3521225ed6c061a3e6052032a99d8573fe..43b561c81750f69bc055ba46863bef543855bd65 100644 (file)
--- a/sendlib.c
+++ b/sendlib.c
@@ -1054,6 +1054,7 @@ BODY *mutt_make_file_attach (const char *path)
   /* Attempt to determine the appropriate content-type based on the filename
    * suffix.
    */
+
   if ((n = lookup_mime_type (buf, path)) != TYPEOTHER)
   {
     att->type = n;
@@ -1070,7 +1071,6 @@ BODY *mutt_make_file_attach (const char *path)
        */
       att->type = TYPETEXT;
       att->subtype = safe_strdup ("plain");
-      mutt_set_body_charset(att, get_text_charset(att, info));
     }
     else
     {
@@ -1079,9 +1079,14 @@ BODY *mutt_make_file_attach (const char *path)
     }
   } 
 
+  /* XXX - just call mutt_update_encoding? -tlr */
+
   mutt_set_encoding (att, info);
   mutt_stamp_attachment(att);
 
+  if (att->type == TYPETEXT)
+    mutt_set_body_charset(att, get_text_charset(att, info));
+  
 #ifdef _PGPPATH
   /*
    * save the info in case this message is signed.  we will want to do Q-P
@@ -1092,8 +1097,6 @@ BODY *mutt_make_file_attach (const char *path)
   info = NULL;
 #endif
 
-
-
   safe_free ((void **) &info);
 
   return (att);
@@ -1122,7 +1125,7 @@ BODY *mutt_make_multipart (BODY *b)
   new->type = TYPEMULTIPART;
   new->subtype = safe_strdup ("mixed");
   new->encoding = get_toplevel_encoding (b);
-  mutt_generate_boundary(&new->parameter);
+  mutt_generate_boundary (&new->parameter);
   new->use_disp = 0;  
   new->parts = b;