<div class="gmail_quote">On Sat, Jun 20, 2009 at 3:50 AM, Aristotle Pagaltzis <span dir="ltr">&lt;<a href="mailto:pagaltzis@gmx.de">pagaltzis@gmx.de</a>&gt;</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> &lt;<a href="mailto:seasprocket@gmail.com">seasprocket@gmail.com</a>&gt; [2009-06-19 06:30]:&gt;<br><div class="im">
&gt; The problem was fixed by calling utf8::decode on the data prior<br>
&gt; 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&#39;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&#39;s not).<br><br>I agree something&#39;s broken, I just don&#39;t know what it is ... My suspicion is that I don&#39;t really understand what&#39;s happening inside sqlite -- I assume it&#39;s storing as UTF-8, but I don&#39;t really know what it&#39;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 // &lt;<a href="http://plasmasturm.org/" target="_blank">http://plasmasturm.org/</a>&gt;<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&#39;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>