I hacked up some perl code that will process the emails Mie sends me from her cell phone and translate the JIS X 0208 character set into Unicode HTML Entities.
#look for the JIS X 0208-1983 enocded block
# (see http://lfw.org/text/jp.html#iso2022)
while ($message =~ /(\x1b\x24\x42)(.+)(\x1b\x28\x42)/) {
$encoded = $2;
$message =~ s/\x1b\x24\x42//;
$message =~ s/\x1b\x28\x42//;
$unicodeEntities = &decode( $encoded );
$message =~ s/$encoded/$unicodeEntities/;
}
view full code
Doing it this way requires that the browser has the Japanese character set installed (which is easy to do for MSIE or Mozilla/Netscape) ...but I might consider instead translating the japanese characters to a series of small gifs for those who are not willing to install the character set (like Shoduka). I -am- lazy though.









You go, code warrior.
Posted by: Laura | 2002.12.10 at 09:34 AM