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

Bernhard Graf catalyst4 at augensalat.de
Tue Nov 24 12:32:35 GMT 2009

Tomas Doran schrieb:

> The FastCGI engine doesn't do anything with encoding/uft8, and nor does
> FCGI.pm
> This probably means (I'm guessing) that the xs part of FCGI doesn't
> correctly handle buffers which are characters rather than bytes.

I wrote a test program to keep all possible side effects away.
It is here http://scsys.co.uk:8001/36569 and it shows (using option -u),
that FCGI indeed encodes all data as soon as the utf-8 flag is on.

This is very interesting, because the latest FCGI release is nearly
seven years old. Did the utf-8 flag exist at that time at all?
Is there something in Perl's guts that does such encoding automatically?

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

I know hardly anything about Perl XS code. Maybe someone with a clue
could have a look at FCGI.xs^H^HXL?

As a quick fix, we could utf8::downgrade($buffer) in
Catalyst::Engine::FastCGI right before syswrite. Doesn't hurt, as far as
I understand.


More information about the Catalyst mailing list