in reply to Creating MIME entities with CRLF line endings

Did you consider to leave \n's of MIME:: as they are, collect whatever MIME:: outputs, and manually replace \n's to CRLFs? If you should adopt this method, you will have to maintain a clean division line, which scalars contain newlines encoded as CRLF, and which contain system-specific newlines. The conversion between these is trivial, s/\n/\xD\xA/g unless "\n" eq "\xD\xA" and vice versa.

Replies are listed 'Best First'.
Re^2: Creating MIME entities with CRLF line endings
by sgifford (Prior) on Mar 16, 2007 at 14:19 UTC
    Thanks dk,

    The problem is that this will also change newlines in the binary parts. I could parse the message to figure out what parts are binary and ignore them, but then I will have gone and written a MIME parser, and I might as well have written a MIME generator.