On Thu, Jan 04, 2007 at 06:55:32PM +0000, Angus Leeming wrote:

> Enrico Forestieri wrote:
> > PS: I see that following the current fashion you started
> > using utf8, but please fix the headers of your mailer as it currently
> > adds: Content-Type: text/plain; charset=us-ascii such that mutt
> > mangles your name...
> 
> The Content-Type header refers to the body of the mail. The body of André's 
> mail is indeed ASCII. That's orthogonal to the fact that he can have a 2047-
> encoded From: header
>     From: =?utf-8?q?André Pönitz <...>?=
> (See http://en.wikipedia.org/wiki/MIME). If you configure mutt to add a line:
>     On Thu, Jan 04, 2007 at 05:05:18PM +0000, Andr??? Poenitz wrote:
> then it's mutt's responsibility to handle the encoding of this name. Send them
> a bug report.

Given that only the é was wrong, I didn't think about rfc2047.
However, you're right that the problem lies in the 2047-encoded header.
This is the From: header used by André's mailer:

     From: =?utf-8?B?QW5kcu+/vQ==?= Poenitz <...>

and the problem is that the base64 encoding is wrong:

$ echo -n "QW5kcu+/vQ==" | (base64 -d; echo)
Andr�

Indeed, it should be

     From: =?utf-8?B?QW5kcsOp?= Poenitz <...>

as easily demonstrated:

$ echo -n "QW5kcsOp" | (base64 -d; echo)
André

This damn'd cygwin doesn't support utf8, so the above output is "André"
as shown in the current 8bit locale which happens to be iso-8859-1.

So mutt is not at fault here. However, I see another kind of bug as
your email clearly specifies utf-8 as the charset, but mutt ignores
it, seemingly. Mutt honours the charset specification for the headers but
not for the email body. I checked that this bug is not present on linux,
so this is something related to the cygwin version. Or maybe to the
version of mutt.

BTW, I would have expected much better from you, Angus ;-)
Your example "From: header" above is not rfc2047 compliant as
1) you specify a quoted-printable encoding, but you use 8bit chars
2) you cannot use spaces in the encoded text
3) you cannot include the address in the encoded text

Going back to serious, thanks for your (as always) valuable input!

-- 
Enrico

Reply via email to