[Catalyst] Re: Avoiding UTF8 in Catalyst

Carl Johnstone catalyst at fadetoblack.me.uk
Mon Nov 23 14:29:19 GMT 2009


Aristotle Pagaltzis wrote:
>     # everything should be bytes at this point, but just in case
>     $response->content_length( bytes::length( $response->body ) );
>
> I was shocked to discover this! Any code that uses bytes::length
> is automatically broken.

Not in this case, the HTTP spec says that the Content-Length header should 
contain the number of octets in the body. If you're sending UTF-8 then this 
is likely different to the number of characters in the string.

 Carl




More information about the Catalyst mailing list