mutt, ISO-8859-1, and Terminal.app

Ryan Schmidt ryandesign at macports.org
Tue Sep 9 14:05:18 PDT 2008


On Sep 9, 2008, at 1:03 PM, Jens Troeger wrote:

> On Tue, Sep 09, 2008 at 07:49:23AM -1000, Baron Fujimoto wrote:
>
>> On Tue, 9 Sep 2008, Jens Troeger wrote:
>>
>>> I'm running on OS-X 10.4.11 and Terminal version 1.5.1 (133-1).   
>>> Just
>>> recently I installed MacPorts, including mutt-devel so that I can  
>>> access
>>> my gmail.com account.  It all works nicely; however, there's one big
>>> annoyance: ISO-8859-1 text.  Some strings in the email header  
>>> contain
>>> such characters:
>>>
>>>   From: "=?ISO-8859-1?Q?Bla Bl=ECn?=" < bla at bla >
>>>
>>> and that's exactly what I see in my email list in mutt.  No  
>>> actual name
>>> with language specific characters, but instead this blob of  
>>> undecoded
>>> string.
>>
>>
>> Is that a properly encoded header?  Section 2 of RFC 2047 says,
>>
>>    IMPORTANT: 'encoded-word's are designed to be recognized as  
>> 'atom's
>>    by an RFC 822 parser.  As a consequence, unencoded white space
>>    characters (such as SPACE and HTAB) are FORBIDDEN within an
>>    'encoded-word'.  For example, the character sequence
>>
>>       =?iso-8859-1?q?this is some text?=
>>
>>    would be parsed as four 'atom's, rather than as a single  
>> 'atom' (by
>>    an RFC 822 parser) or 'encoded-word' (by a parser which  
>> understands
>>    'encoded-words').  The correct way to encode the string "this  
>> is some
>>    text" is to encode the SPACE characters as well, e.g.
>>
>>       =?iso-8859-1?q?this=20is=20some=20text?=
>>
>> and later in section 6.3:
>>
>>    A mail reader need not attempt to display the text associated  
>> with an
>>    'encoded-word' that is incorrectly formed.
>>
>> <http://www.ietf.org/rfc/rfc2047.txt>
>>
>>> Does anybody have an idea what's going on here, and how I can fix  
>>> that?
>>
>> I don't know if this is the source of the problem, but it caught  
>> my eye.
>
> Sorry, I wanted to protect the name encoded in that string, and messed
> it up.  The string that's failing is this one:
>
>   "=?ISO-8859-1?Q?Mia_Det=ECn?="
>
> So that would be a correct string then?

Yes. It decodes to "Mia_Detìn". See:

php -r 'echo utf8_encode(mb_decode_mimeheader("=?ISO-8859-1?Q? 
Mia_Det=ECn?=")) . "\n";'

So could it be that mutt does not support RFC 822-/2047-style subject  
encoding? You'll have to ask the developers of mutt what's going on  
here.






More information about the macports-users mailing list