httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: New charset support breaks existing app charset/utf8 support
Date Sun, 17 Apr 2005 18:00:17 GMT
Markus Wichitill <mawic@gmx.de> writes:

> after updating to yesterday's unstable branch, the existing UTF-8
> support in my application doesn't work anymore, which is probably
> since apreq2 does its own decoding now, and decoding twice fails.

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


> With no documentation yet, I don't know what exactly apreq does, but
> is there a way to switch it all off? 

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);

[...]

> Also, apreq is probably wasting performance by doing more charset
> guessing (?) than necessary for my app, which knows the
> charset/encoding, and therefore only  needs to call utf8::decode with
> no guessing when running in UTF-8 mode, or simply does nothing if not
> running in UTF-8 mode. 

It only validates utf8, it does not "decode" anything.  Try running
without using utf8::decode and see if apreq isn't guessing the charset
right anyways.


-- 
Joe Schaefer


Mime
View raw message