Hi,
as im plunging in the realm of internationalization, im getting more and more confused!
Ok here goes -
I have an HTML form with the charset=euc-jp, my IE browser 6.0 supports that encoding, PERL 5.6, Solaris 2.6.
My HTML form have 2 input fields which is submitted to a perl cgi which simply displays them back on the browser.
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=euc-jp">
</HEAD>
<BODY>
<FORM NAME=TESFORM METHOD=GET ACTION="<TABLE>
<TR>
<TD VALIGN=TOP>Your First Name: </TD>
<TD VALIGN=TOP><INPUT TYPE=TEXT NAME="FIRST_NAME"></TD></TR>
<TR>
<TD VALIGN=TOP><Last Name: </TD>
<TD VALIGN=TOP><INPUT TYPE=TEXT NAME="LAST_NAME"></TD></TR>
<TR<INPUT TYPE=SUBMIT NAME=TYPE VALUE=" Submit "><BR></TD></TR>
</TABLE></FORM></HTML>
My perl cgi script (proc_form.cgi):
#!/usr/local/bin/perl
use CGI;
&CGI::ReadParse ;
$fname = $in{FIRST_NAME};
$lname = $in{LAST_NAME};
print "Content-type: text/html\n\n";
print "<HTML><BODY>\n";
print "<BR>FNAME:$fname\n";
print "<BR>LNAME:$lname\n";
print "</BODY></HTML>\n";
Now, when i submit the form with some japanese chars as first name (copy-pasted from a japanese website and NOT input thru a japanese keyboard) and some latin chars as last name, the CGI correctly displays the last name but my first name is all 'garbage'. It does NOT matter whether i use POST rather than GET. I changed the charset to SHIFT_JIS and UTF-8, i still get garbage displayed back by the CGI.
I noticed that my url thru the GET method is:
My question is what should i do to get the japanese chars i send thru my form to be displayed correctly by the CGI? And why is my last name ("Smith"
correctly displayed by the CGI even tho i preset the charset in the HTML form to euc-jp?
Thanks a lot,
GC
as im plunging in the realm of internationalization, im getting more and more confused!
Ok here goes -
I have an HTML form with the charset=euc-jp, my IE browser 6.0 supports that encoding, PERL 5.6, Solaris 2.6.
My HTML form have 2 input fields which is submitted to a perl cgi which simply displays them back on the browser.
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=euc-jp">
</HEAD>
<BODY>
<FORM NAME=TESFORM METHOD=GET ACTION="<TABLE>
<TR>
<TD VALIGN=TOP>Your First Name: </TD>
<TD VALIGN=TOP><INPUT TYPE=TEXT NAME="FIRST_NAME"></TD></TR>
<TR>
<TD VALIGN=TOP><Last Name: </TD>
<TD VALIGN=TOP><INPUT TYPE=TEXT NAME="LAST_NAME"></TD></TR>
<TR<INPUT TYPE=SUBMIT NAME=TYPE VALUE=" Submit "><BR></TD></TR>
</TABLE></FORM></HTML>
My perl cgi script (proc_form.cgi):
#!/usr/local/bin/perl
use CGI;
&CGI::ReadParse ;
$fname = $in{FIRST_NAME};
$lname = $in{LAST_NAME};
print "Content-type: text/html\n\n";
print "<HTML><BODY>\n";
print "<BR>FNAME:$fname\n";
print "<BR>LNAME:$lname\n";
print "</BODY></HTML>\n";
Now, when i submit the form with some japanese chars as first name (copy-pasted from a japanese website and NOT input thru a japanese keyboard) and some latin chars as last name, the CGI correctly displays the last name but my first name is all 'garbage'. It does NOT matter whether i use POST rather than GET. I changed the charset to SHIFT_JIS and UTF-8, i still get garbage displayed back by the CGI.
I noticed that my url thru the GET method is:
My question is what should i do to get the japanese chars i send thru my form to be displayed correctly by the CGI? And why is my last name ("Smith"
Thanks a lot,
GC