* seasproc...@gmail.com <seasproc...@gmail.com> [2009-06-19 06:30]:
> The issue was that non-ascii chars were appearing as junk BUT
> only when retrieved via ajax calls. Otherwise, they displayed
> fine. The junk display was due to them being interpreted as
> ISO-8859-1, but I could not figure out why the browser was
> interpreting that way. All my data is handled as UTF-8.
>
> The problem was fixed by calling utf8::decode on the data prior
> to sending back via ajax. BUT WHY?

Looks like your code is broken and assumes bytes throughout; as
long as all your data is UTF-8 you won’t notice. Apparently the
JSON serialiser is trying to produce UTF-8 output correctly by
encoding the strings you pass it; since they’re already encoded,
you get double-encoding gremlins.

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

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to