Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users
ajax character encoding issue solved, but WHY?
 

Index | Next | Previous | View Flat


seasprocket at gmail

Jun 18, 2009, 9:23 PM


Views: 975
Permalink
ajax character encoding issue solved, but WHY?

I had a character encoding issue that I finally solved, but I don't
understand why the fix works. I'm hoping someone can explain this to me!

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?

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?

Thanks!



--
==========================
http://www.bikewise.org

2People citizen's network for climate action: http://www.2people.org

Greater Seattle Climate Dialogues: http://www.climatedialogues.org
==========================

Subject User Time
ajax character encoding issue solved, but WHY? seasprocket at gmail Jun 18, 2009, 9:23 PM
    Re: ajax character encoding issue solved, but WHY? onken at houseofdesign Jun 19, 2009, 12:52 AM
    Re: ajax character encoding issue solved, but WHY? phil.mitchell at pobox Jun 19, 2009, 8:25 AM
    Re: ajax character encoding issue solved, but WHY? francesc.roma+catalyst at gmail Jun 19, 2009, 8:51 AM
    Re: ajax character encoding issue solved, but WHY? pagaltzis at gmx Jun 20, 2009, 3:50 AM
        Re: Re: ajax character encoding issue solved, but WHY? seasprocket at gmail Jun 22, 2009, 5:50 PM
    Re: ajax character encoding issue solved, but WHY? pagaltzis at gmx Jun 23, 2009, 1:28 AM
        Re: Re: ajax character encoding issue solved, but WHY? seasprocket at gmail Jun 29, 2009, 11:46 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.