(keitai-l) Re: Fun with Base64 Decoding

From: Brock, Gavin [IT] <gavin.brock_at_nssmb.com>
Date: 10/25/01
Message-ID: <4F7632AA5501D411A7100008C791F4E20389041A@exchjp08.nssmb.com>
Oops, forgot the trailing ?=..

Anyway, all good perl should be done in one line... ;-)

print decode_base64($line =~ m/^\=\?ISO\-2022\-JP\?B\?(.*)\?=$/ && $1);

Gavin


-----Original Message-----
From: Brock, Gavin [IT] 
Sent: Thursday, October 25, 2001 5:52 PM
To: 'keitai-l@appelsiini.net'
Subject: (keitai-l) Re: Fun with Base64 Decoding


Nearly, you need to remove the 'padding' (as the error said)...

my $line = '=?ISO-2022-JP?B?GyRCRnxLXDhsGyhC?=';
my $head = quotemeta('=?ISO-2022-JP?B?'); # Save working this out by hand!!
$line =~ s/^$pat//; # Trim header
print decode_base64($line);


[ excessive quoting removed by moderator ]


[ Need archives? How to unsubscribe? http://www.appelsiini.net/keitai-l/ ]
Received on Thu Oct 25 11:50:59 2001