mod_perl/cgi character encoding issues
I have a web page with a textarea into which users can enter text
including symbols such as á é £.
When I enter the text 'a á £ $' and submit the form under CGI I get
'a \xc3\xa1 \xc2\xa3 $' returned via cgi->param.
Running the same code under mod_perl returns 'a Ã¡ Â£ $' which
looks as though every utf8 byte has been translated into latin1.
Below is an example script to demonstrate the problem.
Can anyone tell me what I need to do to stop this double encoding of
form data under mod_perl?
Or failing that, how I can convert from 'a Ã¡ Â£ $' back to 'a
\xc3\xa1 \xc2\xa3 $'?
my $q = new CGI;
print $q->header("text/html; charset=utf-8");
my $msg = $q->param('AAAA');
print "<br>AAAA: $msg\n" if $msg;
print STDERR "AAAA: $msg\n" if $msg;
CGI-> AAAA: a \xc3\xa1 \xc2\xa3 $
MOD_PERL-> AAAA: a Ã¡ Â£ $
Re: mod_perl/cgi character encoding issues
Some further information that might me useful;
Apache version 2.0.52 with AddDefaultCharset set to UTF-8
mod_perl is version 2.0.0
Perl is version 5.8.6
CGI.pm is version 3.10
|All times are GMT. The time now is 04:11 PM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.