PDA

View Full Version : Json Accentuation Problem



rafaelrp
29 May 2013, 3:08 PM
Hello!

My json is sending this string


data:
{"name":"Cl\u00e1udlia"}



But the correct is "ClŠudia"

any solution for this problem?

Thanks! ~o)

existdissolve
29 May 2013, 4:08 PM
Hello!

My json is sending this string


data:
{"name":"Cl\u00e1udlia"}



But the correct is "ClŠudia"

any solution for this problem?

Thanks! ~o)

What's the problem, exactly? Does it not give the correct value when you decode the JSON string?

rafaelrp
29 May 2013, 5:12 PM
The problem is the value in textfield is "ClŠudia" but the value json send is "{"name":"Cl\u00e1udlia"}"

existdissolve
29 May 2013, 5:25 PM
The problem is the value in textfield is "ClŠudia" but the value json send is "{"name":"Cl\u00e1udlia"}"

Yes...because it's getting JSON-encoded. Once you decode it (presumably server-side), the value will be what you expect it to be (even though, technically, it is already what you expect it to be, only encoded).

DNRDustin
29 May 2013, 8:13 PM
Ext.decode() maybe?

rafaelrp
31 May 2013, 5:43 AM
I'm using json_decode on the php

existdissolve
31 May 2013, 6:08 AM
I'm using json_decode on the php

What version of PHP are you using?

rafaelrp
31 May 2013, 6:10 AM
PHP/5.4.7

existdissolve
31 May 2013, 6:12 AM
PHP/5.4.7

Cool, in that case, try the JSON_UNESCAPED_UNICODE option. http://php.net/manual/en/function.json-encode.php

rafaelrp
2 Jun 2013, 2:00 PM
But the json is already encoded, i need to decode the json correctly with the accentuation..

Thanks!~o)~o)

rafaelrp
9 Jun 2013, 12:36 PM
Up! :)

rafaelrp
16 Jun 2013, 11:38 AM
up! ~o)

rafaelrp
2 Jul 2013, 7:27 PM
up! ~o)