[Catalyst] Re: Avoiding UTF8 in Catalyst

Bill Moseley moseley at hank.org
Wed Dec 9 06:27:09 GMT 2009


On Tue, Dec 8, 2009 at 8:32 PM, Bill Moseley <moseley at hank.org> wrote:

>
>  The UTF8 flag doesn't mean anything more than
>> any of the other SV flags.
>
>
> But the flag on indicates the the string was decoded.
>

Obviously, that's not the only way to get that flag set.  What I meant was
if the flag is on I'm pretty sure I need to encode it before sending out on
the wire.  Yes, all text needs to be encoded, even if the flag is not set --
but at the time the engine is setting the length all that can be checked is
the flag.

Probably a better solution is to look at the content type -- or make
decoding and encoding core in Catalyst so that it's just another part of the
request cycle.  Isn't that the problem here?  That it's not handled and thus
the need to try and fix by using bytes::length?




>   And that implies that it needs to be encoded.  And if I don't know what
> encoding to use then it's time to throw an exception.
>
> That's why it seems like the Engine should throw an exception if the utf8
> flag is set when it's time to get the length.  Because the encoding is not
> known so it's impossible to know the encoded byte length.
>
>
>
>
> --
> Bill Moseley
> moseley at hank.org
>



-- =

Bill Moseley
moseley at hank.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091208/1ed1b=
cc9/attachment.htm


More information about the Catalyst mailing list