Stas wrote:

>Bart, can you test whether you have the same problem when a run the same
code
>under mod_cgi in Apache2 (with perl5.8 ofcourse)? If not, that will point
the
>blaming finger towards mod_perl 2.0.

Well I did that and guess what? mod_cgi fails as well.
So it is not a mod_perl problem
But for me it is still uncertain who to blame. (cgi.pm? apache2? perl5.8?)

I made a small test for this.
Just in case somebody wants to give it a try
Here is my sample page:
-------------
<html xmlns="http://www.w3.org/1999/xhtml"; lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>

<body>
<form method="post" action="/mod_perl/utf8-test.pl"
enctype="multipart/form-data">
<textarea name ='utf8-test' cols='60'>test: &#235; &#8212;</textarea>
&nbsp;&nbsp;<input type="submit" value="publish new content"/></h4>
</form>
</body></html>
------------------
Here is the utf8-test.pl:
-------------------
#!/perl/bin/perl.exe
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);

my $q = CGI->new;
my $content = $q->param("utf8-test");
$content .= "verify with \x{2014}";
my @content = unpack('U*', $content);
$content =~ s/([\x{0800}-\x{FFFF}])/sprintf('+entity:%d+',ord($1))/ge;
$content =~ s/([\x{0080}-\x{07FF}])/sprintf('+entity: %d+',ord($1))/ge;
print $q->header();
print $q->p($content);
print $q->p('hex');
foreach (@content) {printf "%x ", $_}
-----------------------
and here is the output I get:
------------------------
test: +entity: 235+ +entity: 151+verify with +entity:8212+

hex

74 65 73 74 3a 20 eb 20 97 76 65 72 69 66 79 20 77 69 74 68 20 2014
--------------------------

>From which I understand that the original character &#8212; is returned as
hex 97 or dec 151.
And would be correct if the characterset would be window-1252 but that is
not what I expected.
Wanted utf-8 to be returned.

If mod_perl is not the correct forum for this (which I agree it isn't) can
somebody point me in the direction of a correct forum? But as said before
the difficulty is that I don't know who to blame

Kind Regards,

Bart



-- 
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html

Reply via email to