views:

80

answers:

3

Hello, I've a problem loading a JSON with flash class com.adobe.serialization.json.JSON
It works fine with everything except I haven't found a way to load special chars, so if i have

{
    "json_text":"Hello, goodbye! I work fine!"
}

but If i need a special char like àùòèéì it won't work, I've tryied with

{
    "json_text":"òàùèéì I return nothing in my TextField"
}

But flash won't load this chars on my TextField object, so I'ev also tryied:

{
    "json_text":"èà&eacute etc. ERROR ERROR!!"
}

But it return the error by the adobe class... How can avoid the problem?

+1  A: 

Just a shot in the dark (I don't have access to Flash right now) but did you try setting the Content-Type header of the json page to: "application/json; charset=ISO-8859-1" ?

danii
FlashPlayer could only handle utf8 encoding, as far as I know.
Hippo
+1  A: 

I believe special character must be escaped this way: \uffa6\u1234 (\u + hexadecimal representation of the char.)

Hippo
Thanks for the suggestion, I tried it, but seems flash doesn't like it. It Simply doesn't return the special char like my second case
Vittorio Vittori
+1  A: 

Make sure the JSON you load is UTF-8 encoded.

Hippo
When I'll go to office will be my first task! thanks for suggestion
Vittorio Vittori
In fact, it was a php problem!
Vittorio Vittori