12 Apr 2010 00:44
Re: MIME handling
On 10 Apr 2010, at 21:08, Alex Morega wrote: > > On 4 Apr 2010, at 20:30, Alex Morega wrote: > >> Next I'll add more tests and make the parser more resilient to errors. > > Done that, and also removed the call to "LBMIMEStringByDecodingEncodedWord" - it seems that this should be called later, when figuring out what to do with a parsed message. I've sent a pull request if nobody has any objections. Since nobody is complaining, I've messed with the MIME code some more. :) Mostly cleanup, some more tests, a bit of documentation. The parser no longer attempts to decode payloads, and a message will only perform content-transfer decoding, returning an NSData object. Charset decoding is up to the user. Next I'll have a go at writing the MIME generator (the reverse of LBMIMEParser). Afterwards, some tests for encoded header values (RFC 2231) - there seems to be some code for that in LBMIMEParser, but we'll see. So far I've been using the Python email module as a reference, except when it does weird things, presumably for backwards compatibility. Cheers, -- Alex
RSS Feed