in reply to MIME::Base64 is broken in 5.8.2?
use IO::Socket; use MIME::Base64; use strict; use warnings; my $encode = encode_base64("peip:930612"); print "$encode \n"; chomp $encode; inspect($encode); my $decode = decode_base64($encode); print "\n $decode \n"; sub inspect { (my $copy = shift) =~ s/([^[:print:]])/sprintf " (0x%02x) ", ord $ + 1/ge; print $copy; }
and so worked around it.cGVpcDo5MzA2MTI= cGVpcDo5MzA2MTI= peip:930612
Update: The MIME spec allows CRLF characters in Base64:
Note that this means that any CRLF constitute "non alphabet characters" and are ignored. Furthermore, such specifications may consider the pad character, "=", as not part of the base alphabet until the end of the string. If more than the allowed number of pad characters are found at the end of the string, e.g., a base 64 string terminated with "===", the excess pad characters could be ignored."
MADuran
Who is in need of a spiffy sig
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: MIME::Base64 is broken in 5.8.2?
by pg (Canon) on Jan 19, 2004 at 20:57 UTC |