forum

Home / DeveloperSection / Forums / Decode Greek characters in JSON PHP

Decode Greek characters in JSON PHP

Anonymous User373520-Jun-2013
Hi Expert,

I have an XML document that contains greek characters and works perfectly. When I convert it to JSON using PHP the greek characters are being encoded.

      {"id":"101","name":"\u0398\u0397\u039a\u0395\u03a3 \u0397\/\u03a5"}

What I do is: Write xml to a file and then read the file and convert it to JSON

      $handle = fopen("xml_cat.xml","w+");
      fwrite($handle, $xml);
      $sxml = simplexml_load_file('xml_cat.xml');
      echo json_encode($sxml);


How can I get greek characters back?

Any help on above is really appreciated.

Updated on 20-Jun-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By