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