2006/05/26

常用的QP碼轉Big5的Perl Script

把QP碼貼到big5.txt,然後執行下列script

#!/usr/bin/perl

use MIME::Base64;
# Convert Base64 Or Quoted-printable TO Text
open(F,'./big5.txt');
while() {
if ($_=~/=\?[\w-]+\?B\?(.*)\?=$/) {
$_ = decode_base64($1);
};
if ($_=~/=\?[\w-]+\?Q\?(.*)\?=$/) {
use MIME::QuotedPrint;
$_ = decode_qp($1);
};
print "$_\n";
}
close(F);

exit(0);

0 Comments:

Post a Comment

<< Home