[English][Japanese]
Last Modified:
by Dan Kogai
Virtually all Japanese perl coders must have used jcode.pl, a perl code that converts Japanese text from one char set or another. While jcode.pl has all the functinalities necessary, it has following problems;
While it runs OK on perl5, you have to use typegrobs or references to give
jcode::convert()
right arguments. It doesn't look great to say
jcode::convert(\$str, 'jis', jcode::getcode(\$str), "z");
;
print $str
Wouldn't it be nice if you can go like;
print jcode($str)->h2z->jis
;
to do the same?
RFC1522 states
that converting string to iso-2022-jp is not enought to put it into MIME header.
You have to further convert the string with base64, then sandwitch that with =?ISO-2022-JP?B?
and ?=
. Wouldn't it be nice if you can
$header = jcode($str)->encode_mime;
I am not a big fan of Unicode but we have to admit the future is there...
So I have written Jcode.pm. It has all features available on jcode.pl-2.10 PLUS
Here is the documentation, Jcode.html Which is pod2html'd from Jcode.pm.
is easy.
That's it! I will upload this package as soon as field test is complete so as soon as that happens, it will be as easy as "perl -MCPAN -e shell" and "install Jcode".