Click here to get back home

MIME::Base64 bugs?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
MIME::Base64 bugs? sonet 06-05-2007
|--> Re: MIME::Base64 bugs? Gunnar Hjalmars...06-05-2007
Posted by Peter J. Holzer on June 23, 2007, 3:37 pm
Please log in for more thread options


>> The MIME::Base64 will convert \n to \r\n.
>>
>> $a="1234\n4567\n";
>> $a=encode_base64($a,0);
>> print decode_base64($a);
>>
>> The result is 1234\r\n4567\r\n.

Not on my system (perl, v5.8.8 built for i486-linux-gnu-thread-multi,
MIME::Base64 3.07). Are you using Windows?


> Look for http://www.ietf.org/rfc/rfc2045.txt [Page 25]
>
> Care must be taken to use the proper octets for line breaks if
> base64 encoding is applied directly to text material that has not
> been converted to canonical form. In particular, text line breaks
> must be converted into CRLF sequences prior to base64 encoding.
> The important thing to note is that this may be done directly by
> the encoder rather than in a prior canonicalization step in some
> implementations.
>
> This RFC requirement.

For "text material that has not been converted to canonical form", yes.
But base64 is most often used to represent non-text material, such as
images, PDFs, word documents, viruses, etc.

But MIME::Base64 has no way of knowing if the string it is passed is
text material, so it should leave canonicalization to the caller (and it
does, AFAICT).

        hp

--
_ | Peter J. Holzer | I know I'd be respectful of a pirate
|_|_) | Sysadmin WSR | with an emu on his shoulder.
| | | hjp@hjp.at |
__/ | http://www.hjp.at/ |        -- Sam in "Freefall"

Similar ThreadsPosted
Convert from base64 to TIFF or BMP or JPG September 24, 2004, 12:15 am
Output binary data in base64 in YAML January 14, 2005, 7:20 pm
MIME::Types 1.16 and OpenDocument November 9, 2005, 7:48 am
How to log the output of Mime::Lite ? June 26, 2006, 6:52 pm
Perl Module for S/MIME October 19, 2006, 1:58 am
Perl Module for S/MIME October 19, 2006, 1:59 am
Perl Mime::Lite question. Help please? August 24, 2004, 8:45 am
MIME::Lite need sendmail Queue ID November 16, 2006, 9:34 am
MIME::EncWords charset param February 20, 2007, 7:03 pm
Composing MIME-compliant mail messages July 8, 2004, 4:08 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap