I was working on project that had problem when encoding UFT-8 text into JSON Format
<?php
$result = array('wine'=>"测试", 'عربي'=>4, 'lemon'=>22);
echo json_encode($result);
and i also tried Zend_JSON Library ,
<?php
require_once 'Zend/Json.php';
$result = array('wine'=>"测试", 'عربي'=>4, 'lemon'=>22);
echo Zend_Json::encode($result);
in both cases the JSON output was crazy :
{"wine":"\u0639\u0631\u0628\u064a ","\u0639\u0631\u0628\u064a":4,"lemon":22}
i did try it into PHP5.2.6 and PHP5.3 but same result ..
How do I convert UTF-8 text into JSON? Any suggestions?