JSON encode not working with special characters

JSON encode not working with special characters

Hi ,
I am using pear's ( http://pear.php.net/pepr/pepr-proposal-show.php?id=198) package as i have PHP 5.1.6 for JSON encode/decode purpose.
But when i use special characters like &,*,[,+ ,'etc, my stuff from Handson table is not encoded properly and the text going in Mysql DB is not properly JSON encoded and is broken.

So when i display this data on Webpage , it is not displayed at all as it is based on JSON format .

What should i do so that the JSON format don't get break.
I am using this to JSON encode:
  1. <?php include("/home/gpreeti/php/JSON.php"); $json = new Services_JSON(); $marks = array( "mohammad" => array ( "physics" => 35, "maths" => 30, "chemistry" => 39 ), "qadir" => array ( "physics" => 30, "maths" => 32, "chemistry" => 29 ), "zara" => array ( "physics" => 31, "maths" => 22, "chemistry" => 39 ) ); $marks=$json->encode($marks);