Re: https://svn.eprints.org/eprints/trunk/system/tools/atom_multipart.pl
On Wed, 2011-06-22 at 07:41 +0000, Stuart Lewis wrote: > Hi Tim, > > > I've written a very small Perl tool to generate Atom multipart/related: > > https://svn.eprints.org/eprints/browser/trunk/system/tools/atom_multipart.pl > > > > If you notice a mistake in my implementation I'd appreciate knowing :-) > > I've compared that to my PHP implementation**, and have noticed the following > differences: > > - You have 'Media Post' at the top, I did not. I notice that the > examples on the atompub multipart RFC also have that, although I can't > find an explanation about what it means. I have now added this to the > PHP version. It is the content shown by clients that don't understand multipart/* (e.g. plain-text only email clients). > - I have clrf / \r\n between each chunked base64 encoded line, whereas > the perl just seems to have \n. I don't know which is correct, or if > it matters. AFAIK whitespace should be ignored when decoding base64 so it makes no difference. Base64 lines are wrapped to comply with SMTP so strictly we don't need line-feeds at all. Your parser definitely shouldn't rely on 76-char wide lines. > - You have a blank line between the end of the chunked base64 media > part, and the final boundary. I think this might be incorrect. > > I've no idea which is right though! :) That blank line is part of the base64 encoding so, as above, this should be ignored when decoding. /Tim. ------------------------------------------------------------------------------ Simplify data backup and recovery for your virtual environment with vRanger. Installation's a snap, and flexible recovery options mean your data is safe, secure and there when you need it. Data protection magic? Nope - It's vRanger. Get your free trial download today. http://p.sf.net/sfu/quest-sfdev2dev _______________________________________________ sword-app-tech mailing list sword-app-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sword-app-tech