[Catalyst] Re: Encoding problem - ?fastcgi?

Jonathan Rockway jon at jrock.us
Mon Oct 8 20:48:48 GMT 2007

Richard Robinson wrote:
> On Mon, Oct 08, 2007 at 02:07:18PM +0200, A. Pagaltzis wrote:
>   =

>> Hi Richard,
>> did you ever get this sorted? Quoting in full since you seem to
>> have been warnocked. I have no idea what to suggest but am
>> curious about this issue as a matter of personal interest.
>>     =

> Nice word, I hadn't met it before. Exactly - is no-one else doing this, or
> is everyone else doing it with no problem ?
> No, I haven't got any further, I'm kind of stuck on it. The workaround ma=
> it go away for now & there are other things I need to be sorting out too,=
> I'm just kind of waiting for an idea to appear from somewhere ... =

>   =

Can someone *please* distill a test case for this? =

I can guess why this is happening, but I'd like to be sure.  My guess is
that utf8-flagged characters are in $c->res somewhere outside of (the
utf-8 but not flagged as such) $c->res->body.  When the headers and body
are concatenated somewhere down the line, the encoded utf8 octets get
upgraded to wide characters as latin-1, and you have your double encoding.

Without a test case, though, we can't find or fix the bug.  Guessing is
not good enough :)

(As an aside, everything but the body MUST be ascii *only*, but I'm sure
someone thinks that unicode HTTP headers are cute and are using them. =

The version of Catalyst::Plugin::Unicode in trunk will encode
everything, so this might not be a problem.  But, I would like to
understand why this is happening, because it means that there is sloppy
code somewhere.  I think it's about time to make C::P::Unicode the
default, but that's a story for another e-mail.  Summary: "Caught
exception in engine: wide characters in syswrite.")

Jonathan Rockway

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 370 bytes
Desc: OpenPGP digital signature
Url : http://lists.scsys.co.uk/pipermail/catalyst/attachments/20071008/dfa8=

More information about the Catalyst mailing list