Users Pricing

forum

home / developersection / forums / decode greek characters in json php

Decode Greek characters in JSON PHP

Anonymous User 4290 20 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.

I am a content writter !


1 Answers