in reply to Re: cgi email Japanese contents scripting problem
in thread cgi email Japanese contents scripting problem

Hi,

Thanks for taking the time to think about and respond to my inquiry.

I believe you are correct about the header which perhaps should have something like:

content-transfer-encoding ISO-2022-JP

and also perhaps

content-type xxsomething

There are several problems here:

1. I don't know perl programming, so I don't know what or where to put { }; etc.

2. And, then where do these lines go in the script?

I apologize for trying to get an easy solution to this problem.

Regards,

Jim
  • Comment on Re: Re: cgi email Japanese contents scripting problem

Replies are listed 'Best First'.
Re: Re: Re: cgi email Japanese contents scripting problem
by mpolo (Chaplain) on Jan 01, 2002 at 20:30 UTC
    No problem. First the obligatory point. If you value the security of your web site, it is much better to use CPAN modules like CGI.pm to handle your CGI needs, something like Mail::Sendmail to handle the mailing, and something like MIME::Lite to create a nice MIME packet.

    Right now though, you're trying to get something to work and probably won't be willing to wade through all that. So as an interim workaround, I would suggest inserting into the part of the program that prints out the Header (The first group of print MAIL "....."; (up to print MAIL "\n\n", which ends the header) the following (not tested, as I don't know Japanese...)

    print MAIL "Content-Transfer-Encoding: ISO-2022-JP\n"; print MAIL "Content-Type: text/plain\n";
    But be careful with this! You are taking input that the user has input onto a webform and then blithely sending it out to an external program (usually sendmail). Someone who knows you were doing that could try sending a code to end the sendmail input followed by a command to do something nasty to your server.

    If you use Super Search you should be able to get a lot of information about CGI security and see how to patch this up better. Or, for an easier way, davorg, one of our resident monks, and the London Perl Mongers are working on easy programs to allow you to set this kind of thing up without giving away all the security. Look for it here: nms.