<div class="gmail_quote">On Sat, Jun 20, 2009 at 3:50 AM, Aristotle Pagaltzis <span dir="ltr"><<a href="mailto:pagaltzis@gmx.de">pagaltzis@gmx.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
* <a href="mailto:seasprocket@gmail.com">seasprocket@gmail.com</a> <<a href="mailto:seasprocket@gmail.com">seasprocket@gmail.com</a>> [2009-06-19 06:30]:><br><div class="im">
> The problem was fixed by calling utf8::decode on the data prior<br>
> to sending back via ajax. BUT WHY?<br>
<br>
</div>Looks like your code is broken and assumes bytes throughout; as<br>
long as all your data is UTF-8 you won’t notice. Apparently the<br>
JSON serialiser is trying to produce UTF-8 output correctly by<br>
encoding the strings you pass it; since they’re already encoded,<br>
you get double-encoding gremlins.</blockquote><div><br>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.<br>
<br>I have confirmed this by checking to see if Encode::encode is getting called in C::V::JSON (it's not).<br><br>I agree something's broken, I just don't know what it is ... 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.<br>
<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
Regards,<br>
<font color="#888888">--<br>
Aristotle Pagaltzis // <<a href="http://plasmasturm.org/" target="_blank">http://plasmasturm.org/</a>><br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>==========================<br><a href="http://www.bikewise.org">http://www.bikewise.org</a><br><br>2People citizen's network for climate action: <a href="http://www.2people.org">http://www.2people.org</a><br>
<br>Greater Seattle Climate Dialogues: <a href="http://www.climatedialogues.org">http://www.climatedialogues.org</a><br>==========================<br>