0

I'm using Zend_Json (actually, I'm using ajaxContext with automatic json serialization), and I need to send Japanese chars encoded in Utf-8.

I receive from my ajax request such data :

{"comments":"\\u65e5\\u672c\\u6700"}

Now, what can I do with that? to "translate" it into readable chars in my html page?

thank you

2
  • Try disabling magic quotes, and Zend_Json (actually json_decode) will automatically transform it into valid UTF-8 sequences usable in a html page. Commented Jun 17, 2011 at 18:48
  • Hi, thank you for your suggestion, however: user@host:~$ php -i | grep "magic" magic_quotes_gpc => Off => Off magic_quotes_runtime => Off => Off magic_quotes_sybase => Off => Off Commented Jun 18, 2011 at 13:23

1 Answer 1

1

You can use jquery json parser for decode chars.

jQuery.parseJSON(response);

This function convert encoded chars to readable chars in html.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.