Users Pricing

forum

Home Forums Decode Greek characters in JSON PHP – MindStick

Decode Greek characters in JSON PHP

Anonymous User 4411 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.

1 Answers

Markdown for AI

A clean, structured version of this page for AI assistants and LLMs.

Open .md