Mantis - Quercus
Viewing Issue Advanced Details
2092 minor sometimes 10-19-07 09:07 09-04-08 16:57
hendler  
ferg  
normal  
closed 3.1.3  
fixed  
none    
none 3.2.1  
0002092: json_encode (or another part of the Resin system) should return UTF-8 - maybe
http://php.net/json_decode [^] requires UTF-8 - it seems.

To reproduce - have a 5.2.1 regular PHP as a json_decode client. Do a json_encode from quercus containing UTF-8 chars.

The json_decode will return false (see notes - it may be the Zend HTTP client that does this.)
My workaround is to do this in the PHP environment, where $response->getBody() is from Zend Framework HTTP client (which I'm sorry to say may actually be the problem - but I thought I'd post it here in case it comes up again).

This converts the string to UTF-8.
...
$response_converted = (function_exists('iconv'))? iconv("ISO-8859-1","UTF-8", $response->getBody()):$response->getBody();
return json_decode($response_converted,true);

Notes
(0003390)
ferg   
09-04-08 16:57   
php/470b