[Catalyst] Re: Unicode trouble with Catalyst::Engine::FastCGI

Aristotle Pagaltzis pagaltzis at gmx.de
Tue Nov 24 16:41:03 GMT 2009


* Tomas Doran <bobtfish at bobtfish.net> [2009-11-23 23:20]:
> This probably means (I'm guessing) that the xs part of FCGI
> doesn't correctly handle buffers which are characters rather
> than bytes.

That was my initial guess.

> We can get this fixed, but not without test cases, and I'm
> struggling to reproduce the issue here.
>
> Help?

Glad that Bernhard stepped up because I’ve never used FCGI. :-)


* Bernhard Graf <catalyst4 at augensalat.de> [2009-11-24 13:40]:
> As a quick fix, we could utf8::downgrade($buffer) in
> Catalyst::Engine::FastCGI right before syswrite. Doesn't hurt,
> as far as I understand.

It wouldn’t even necessarily be a quick fix in this case, IMO. It
would be preferrable to fix it in FCGI, but if the maintainer is
gone and a new version is not likely to happen, then downgrading
in the FastCGI engine would be the correct and proper fix. Any
fix in the XS code would effectively imply a transient downgrade
anyway. If the body string represents an encoded octet sequence,
then downgrading will always succeed, as well.

(If it’s not downgradeable, then the engine should probably throw
an exception, as mentioned in the other thread.)

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



More information about the Catalyst mailing list