--- /home/makoto/mhonarc.pl-1.23.8.2 Sun Apr 27 18:07:50 2003 +++ mhonarc.pl Mon Apr 28 09:38:54 2003 @@ -31,6 +31,8 @@ require 'gfilter.pl'; require 'html.pl'; require 'mailnews.pl'; +use MIME::Base64; +use Jcode; # # This pattern specifies MHonArc's file names. @@ -156,14 +158,21 @@ if ($mha_head =~ //) { my $subject = uncommentize($1); + $subject = base64toeuc($subject); 1 while ($subject =~ s/\A\s*(re|sv|fwd|fw)[\[\]\d]*[:>-]+\s*//i); $subject =~ s/\A\s*\[[^\]]+\]\s*//; $fields->{'subject'} = $subject; } if ($mha_head =~ //) { - $fields->{'from'} = mrot13(uncommentize($1)); + my $from = uncommentize($1); + $from = mrot13($from); + $from = base64toeuc($from); + $fields->{'from'} = $from; } elsif ($mha_head =~ //) { - $fields->{'from'} = uncommentize($1); + my $from = uncommentize($1); + $from = mrot13($from); + $from = base64toeuc($from); + $fields->{'from'} = $from; } if ($mha_head =~ //) { $fields->{'message-id'} = '<' . uncommentize($1). '>'; @@ -173,6 +182,12 @@ } } +sub base64toeuc { + my $str = shift; + $str =~ s/=\?iso-2022-jjp\?b\?([0-9A-Za-z\+\/\=]+)\?=/MIME::Base64::decode($1)/egi; + Jcode::convert(\$str,'euc'); + return $str; +} sub uncommentize { my($txt) = $_[0]; $txt =~ s/&#(\d+);/pack("C",$1)/ge;