« Return to Thread: ajax character encoding issue solved, but WHY?

Re: ajax character encoding issue solved, but WHY?

by Francesc Romà i Frigolé-2 :: Rate this Message:

Reply to Author | View in Thread


On Fri, Jun 19, 2009 at 6:23 AM, <seasprocket@...> wrote:

The problem was fixed by calling utf8::decode on the data prior to sending back via ajax. BUT WHY?

I am using the JSON view to render ajax responses, and it sets the charset header correctly to UTF-8. Of course, even when you decode, perl still represents as "internal" utf8. But why should this be necessary?


I had exactly the same problem and solution using Catalyst::Controller::REST with the JSON serializer. Still in my list of 'big mysteries to be solved'. 

I hadn't discovered Catalyst::Plugin::Unicode back then, I wonder if using it would help, haven't tried myself yet.

Cheers
Francesc

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

 « Return to Thread: ajax character encoding issue solved, but WHY?