On Fri, Sep 06, 2002 at 11:21:09PM -0700, Michael Elkins wrote: > Brian Grayson wrote: > > Hm. I have 1.2.5 source locally, and it looks like in > > mutt_set_encoding() in sendlib.c, the following logic may be > > faulty: > > I just noticed that you are using an extremely ancient version of Mutt > (0.95). Please try using Mutt 1.4, which is the current stable version. > The logic for picking the CTE is much more complex now, and it should > address your issue.
I downloaded 1.4 on Friday just to see, and the same problem occurs. The fundamental problem is once the CTE code sees a nonzero value of lobin, it goes into quoted, regardless of whether hibin is nonzero. The following patch does the right thing for my testcase here, but I don't know if there's a good reason why the lobin/quotable check currently ignores whether there are any hibins or not. After a bit of inspection, the file rep.5k has hibins and _no_ lobins, and hence goes properly into 8bit encoding. But the file rep1k has a lobin (0x0b at offset 0x340, for example), so it short-circuits into quoted-printable. Try mailing the base64-encoded version of that to yourself, and it should choose quotable, even in 1.4. Brian -- Brian Grayson, SysPerf (System Performance, Modeling, and Simulation) Somerset Design Center Motorola Austin, TX
--- sendlib.c Sat Apr 20 02:25:49 2002 +++ sendlib.c.mod Fri Sep 6 21:27:18 2002 @@ -1196,10 +1196,12 @@ if (b->type == TYPETEXT) { char *chsname = mutt_get_body_charset (send_charset, sizeof (send_charset), b); - if ((info->lobin && strncasecmp (chsname, "iso-2022", 8)) || info->linemax > 990 || (info->from && option (OPTENCODEFROM))) - b->encoding = ENCQUOTEDPRINTABLE; - else if (info->hibin) + if (info->hibin) + { b->encoding = option (OPTALLOW8BIT) ? ENC8BIT : ENCQUOTEDPRINTABLE; + } + else if ((info->lobin && strncasecmp (chsname, "iso-2022", 8)) || info->linemax > +990 || (info->from && option (OPTENCODEFROM))) + b->encoding = ENCQUOTEDPRINTABLE; else b->encoding = ENC7BIT; }