Characters Modified in a Curl Request

When I look at the XML data feed that I get with the code below, the special characters are correct in the XML code. However, when Curl returns data, characters such as "ó" and "ä" are converted to acc. "ó" and "ä". This conversion occurs with all special characters, these 2 are just an example.

$myvar = curl_init();
$myURL = "http://someurl.com/";
curl_setopt($myvar, CURLOPT_USERAGENT, '[Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2")]');
curl_setopt($myvar, CURLOPT_URL, $myURL);
curl_setopt($myvar, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($myvar, CURLOPT_TRANSFERTEXT, TRUE);
curl_setopt($myvar, CURLOPT_CONNECTTIMEOUT,3);
$xmlstr = curl_exec ($myvar);

The header of the XML file says that it is encoded as follows: "? Xml version =" 1.0 "encoding =" UTF-8 "?"

All I want is to get the same characters as in the Curl results, without any conversions.

Hope I just skipped a simple easy step, looking forward to any answers.

Regards Fons

+5
1

, $xmlstr ? - , , , UTF-8, cURL .

cURL UTF-8 - , - . -, . - , cURL, , , ASCII.

+6

All Articles