[ back to toc ]

foreign Language customizaion

Date: 2002/01/16 10:57

Q:
Hi Peter,

How to I change the email portion (see below) of a perl cgi script to
accept a language other than English? In my case, I want it to send
Japanese. The way it is now, it scrambles the Japanese text, and it is
unreadable. I know that iso-2022-jp has to go in there someware but I'm
not sure where. Can you help me?

Other than this issue, the script works perfectly!

Here is the script:

# Open The Mail Program
open(MAIL,"|$mailprog -t");
print MAIL "To: $FORM{'tomail'}\n";
>print MAIL "From: $FORM{'frommail'} ($FORM{'fromname'})\n";

print MAIL "Subject: $FORM{'subject'}\n\n";

print MAIL "japanese $FORM{'toname'}!\n\n";

print MAIL $FORM{'message'};
print MAIL "\n\n";
print MAIL "japanese\n\n";
print MAIL "$FORM{'fromname'}\n\n";

close (MAIL);
A:
I have never done that, but according to the MIM standard I think what you
need is

print MAIL "Content-Type: text/plain; charset=iso-2022-jp\n";

somewhere before printing the subject line.

Regards,
Peter

[ back to toc ]