httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wichitill <>
Subject Re: New charset support breaks existing app charset/utf8 support
Date Sun, 17 Apr 2005 19:00:49 GMT
Joe Schaefer wrote:
> Use $param->charset() to see what apreq thinks the charset is.
> You need something like (untested)
>     $body = $req->body;
>     $body->param_class("APR::Request::Param");
>     my $funky_param = $body->{foo};
>     print "charset = ", $funky_param->charset; # 0 = ascii, 8 = utf8
> apreq just marks the charset.  IIRC (I have to run now, sorry if this is
> wrong) you should be able to turn off the utf8 stuff via:
>     $funky_param->charset(0);

Having to deal with Param objects when I only want to fetch a simple string 
via $apr->param() seems overly complicated to me. I was hoping for a 
$apr->charset_support(1) config method that only switches on charset 
processing when requested.

Perl 5.8.1+ and most CPAN modules that have added UTF-8 support don't set 
any utf8 flags unless they've been asked to, for good reason. For example, 
all the trouble that Perl 5.8.0 had caused when it used utf8 by default on 
machines with UTF-8 locales proved why utf8 flags shouldn't be forced on 
users. Things will just fail on so many fronts.

> without using utf8::decode and see if apreq isn't guessing the charset
> right anyways.

It does, but I'd still rather use utf8::decode myself, because then I don't 
have to do different error handling etc. for apreq2, apreq1 and the pureperl 
parser for non-mod_perl platforms. And I don't even want to know what 
happens if apreq2 sets utf8 flags when running under Perl 5.6.

View raw message