The
third party (
http://mike.teczno.com/json.html)
PHP JSON library which AJASON is using requires all strings to be encoded in UTF-8. Thus since version 0.9 AJASON provides the
option
Ajax::EncodeOption. If set to true the return value of the method or
function which has been called by the client will be encoded to UTF-8
before passed back to the client. If told to, AJASON takes care of
plain strings, strings in arrays and strings in objects. Because the
function
utf8_encode (http://www.php.net/manual/en/function.utf8-encode.php) is being used for the conversion, strings need to be returned in ISO-8859-1 encoding first.
This leaves us with two options:
- Make sure the return value contains strings in ISO-8859-1 and enable Ajax::EncodeOption or
- Don't use Ajax::EncodeOption and encode the strings into UTF-8 yourself before returning them