[Catalyst] Re: ajax character encoding issue solved, but WHY?

Aristotle Pagaltzis pagaltzis at gmx.de
Tue Jun 23 08:28:01 GMT 2009


* seasprocket at gmail.com <seasprocket at gmail.com> [2009-06-23 03:00]:
> Thanks for your suggestion, but I'm pretty sure that the data
> is not getting encoded twice. C::V::JSON tests the data before
> it encodes ( Encode::is_utf8() ) and only encodes if this test
> is true. This test only passes if the data is decoded.

Augh! Augh! Why do people keep reading stuff into the UTF8 flag
that it doesn’t mean. (Yeah, I know why, because it’s called the
UTF8 flag when it should’ve been the UOK flag or something.) You
can have decoded data with the UTF8 flag off, and you can have
encoded data with the UTF8 flag on. The UTF8 flag is about the
internals-level format of the byte buffer of a scalar, it has
nothing to do with the meaning of the data on the Perl level.
Testing the flag in pure-Perl code is an almost certain sign of
brokenness.

> My suspicion is that I don't really understand what's happening
> inside sqlite -- I assume it's storing as UTF-8, but I don't
> really know what it's doing.

Try Devel::Peek to examine the strings that come out of it?

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



More information about the Catalyst mailing list