(keitai-l) Re: Fun with Base64 Decoding

From: Renfield Kuroda <Renfield.Kuroda_at_morganstanley.com>
Date: 10/25/01
Message-ID: <3BD7D4FE.E85612FF@morganstanley.com>
Looks like he already did that:

> ### ... detect a Base64 encoded line .. ###
> ###   strip control characters, leaving this: GyRCRnxLXDhsGyhC ###

So I'm guessing the issue is one of display. After base64 decoding, you will
have a string of iso-2022-jp Japanese which will most likely NOT display
correctly unless you've got a properly configured xterm or something. So it
probably was working but unconfirmed as it displayed as gibberish.

r e n



"Brock, Gavin [IT]" wrote:

> 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);
>
> Works for me!!
>
> Maybe this should be patched into Jcode.pm. I'll try if I have time.


[ excessive quoting removed by moderator ]



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