KMimeH.pm - Mime-encoded-header decoder/encoder
use KMimeH;
my $head = "Subject: =?iso-2022-jp?B?GyRCSH4kNyQkRnxLXDhsGyhC?=\n"; print $head; KMimeH::decode( \$head ); print $head; $head =~ s/^(Subject:)\s*((Re|Fwd?)[:>]\s*)*/$1 Re: /i; KMimeH::encode( \$head ); print $head;
KMimeH::decode( REF, [OUTCODE] );
Convert string reffered by REF from mime header to OUTCODE string. Default OUTCODE is ``euc''. ``jis'' and ``sjis'' are also permitted.
KMimeH::encode( REF, [OUTCODE], [INCODE] );
Convert string reffered by REF from INCODE string to mime header of OUTCODE. Default OUTCODE is ``ISO-2022-JP'' (jis). ``sjis'' and ``euc'' are also permitted.
KMimeH.pm supports Unicode (UTF-8) conversion with Jcode.pm. At first, re-define following virtual functions to call Jcode.
*KMimeHP::jcode_convert = \&Jcode::convert; *KMimeHP::jcode_getcode = \&Jcode::getcode;
And you can use ``utf8'' as INCODE or OUTCODE.
jcode.pl or Jcode.pm is required.
1999/11/23 v1.00 First version
http://www.kawa.net/works/perl/kmimeh/ (KMimeH.pm) ftp://ftp.iij.ad.jp/pub/IIJ/dist/utashiro/perl/ (jcode.pl) http://openlab.ring.gr.jp/Jcode/ (Jcode.pm)
Kawasaki Yusuke u-suke [at] kawa.net