[Catalyst] Re: Avoiding UTF8 in Catalyst

Aristotle Pagaltzis pagaltzis at gmx.de
Sun Nov 22 13:10:29 GMT 2009


* Marc SCHAEFER <schaefer at alphanet.ch> [2009-11-21 23:30]:
> After investigating, the Content-Length: is one off per non
> 7-bit character. As if the standard iso-8859-1 byte stream was
> sent as is, but was, internally converted to UTF-8 just for
> generating a wrong byte count. Very strange. Normally that
> process should really output something wrong or generate an
> error in the conversion. It doesn't.

No, it was not converted to UTF-8. Its internal representation
was upgraded. That’s not the same thing (and if you think it is,
you have at the very least not understood Unicode in Perl). It
should have no observable effect.

As a quick fix, you want to utf8::downgrade the $c->res->body at
the last moment before emitting the data to the wire. I’m not
sure off hand which method to wrap in the application class to do
that, though.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list