Re: MIME::Base64 bugs?



On Jun 5, 2:21 pm, "sonet" <sonet....@xxxxxxxxxxxxx> wrote:
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.

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.

Regards, LIOL

.



Relevant Pages

  • Re: MIME::Base64 bugs?
    ... must be converted into CRLF sequences prior to base64 encoding. ... For "text material that has not been converted to canonical form", ...
    (comp.lang.perl.modules)
  • Re: Trasferire file
    ... The Base64 Content-Transfer-Encoding is designed to ... The encoding and decoding algorithms ... as output strings of 4 encoded characters. ... that this may be done directly by the encoder rather than in ...
    (it.comp.macintosh)
  • Re: base64
    ... I just did a google search and found that there are base64 encoders and ... mimencode - Translate to and from mail-oriented encoding formats ... encoded version of the input to standard output. ... Copyright 1991 Bell Communications Research, Inc. (Bellcore) ...
    (comp.os.linux.misc)
  • Re: Base64 ohne + und /
    ... Ohne + und / ist es kein Original Base64 mehr. ... Creates a Base64 codec used for decoding and encoding ... up being multiples of 4 in the encoded data. ...
    (de.comp.lang.java)
  • Re: Attached image sent as "application/octet-stream"
    ... MIME has different encoding ideas, plus it describes the data it encodes (as an example, ... part of the encoded file is Content-Type) and MIME-QP is the default for HTML messages. ... happened when I sent messages in HTML format I have now changed the encoding from Quoted Printable to Base64, and now the files are attached properly. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)