Services REST API and special characters I'm using REST Services to communicate between two websites.

Once a node is updated on the website 1, part of the information is sent to the website 2. This works without any problems.

However, all special characters, e.g. apostrophes, are received escaped.

For example: "It's a sample page", will be received as "It\'s a sample page".

Here is the code I'm using:

// $data is just an example. It's more complex and the only relevant part is the
// way node title is passed.
$data = array('title' =&gt; $node-&gt;title);

$curl = curl_init('http://example.com/rest/node/1');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_HEADER, FALSE);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_FAILONERROR, TRUE);


How can I avoid this? Is there any encoding/decoding I need to do prior to building HTTP query?

Thanks!
It looks as though your PHP install might be configured with the deprecated Magic Quotes


  When on, all ' (single-quote), " (double quote), \ (backslash) and
  NULL characters are escaped with a backslash automatically.


More info: Disabling Magic Quotes