X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=handler.c;h=251f4795ec0352ec78485f4aaefe99b14ced8bb6;hb=be2ccfaadec4e4f6e059007247c18ffb372a05a4;hp=9cadb72c03f13b15237460f947bf873a8d19e45a;hpb=0c528da3f6976cfef3d729d9cd66bd8f265a4060;p=apps%2Fmadmutt.git diff --git a/handler.c b/handler.c index 9cadb72..251f479 100644 --- a/handler.c +++ b/handler.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include @@ -1207,8 +1211,6 @@ static void print_flowed_line(char * line, STATE *s,int ql) { int len = strlen(line); int i; - fprintf(stderr,"prefix = `%s'\n",s->prefix); - width = COLS - WrapMargin - ql - 1; if (option(OPTSTUFFQUOTED)) --width; @@ -1868,11 +1870,21 @@ void mutt_decode_attachment (BODY *b, STATE *s) Quotebuf[0] = '\0'; - if (istext && s->flags & M_CHARCONV) + if (istext) { - char *charset = mutt_get_parameter ("charset", b->parameter); - if (charset && Charset) - cd = mutt_iconv_open (Charset, charset, M_ICONV_HOOK_FROM); + if(s->flags & M_CHARCONV) + { + char *charset = mutt_get_parameter ("charset", b->parameter); + if (!option (OPTSTRICTMIME) && !charset) + charset = mutt_get_first_charset (AssumedCharset); + if (charset && Charset) + cd = mutt_iconv_open (Charset, charset, M_ICONV_HOOK_FROM); + } + else + { + if (b->file_charset) + cd = mutt_iconv_open (Charset, b->file_charset, M_ICONV_HOOK_FROM); + } } fseek (s->fpin, b->offset, 0);