Forum Moderators: coopster
I have a small problem regarding the output of curl with PHP in regards to fetching & parsing RSS feeds and unusual characters within the feeds, such as the Euro sign.
Example feed
<snip>
When using curl as a standalone and outputting to file, the Euro character is retained. When using PHP/cURL, the Euro sign is converted into 2 or more "garble" characters.
Is there a particular curl_setopt option I should be using? cURL on its own and file_get_contents() seem to retain the character as is, but my current PHP/cURL function doesn't.
None of the current curl_setopt options I use are related to encoding, i.e. just CURLOPT_TIMEOUT etc.
Any thoughts? feedback appreciated...
[edited by: brotherhood_of_LAN at 11:17 am (utc) on Oct. 25, 2007]
[edited by: dreamcatcher at 11:21 am (utc) on Oct. 25, 2007]
[edit reason] no urls as per T.O.S [webmasterworld.com].Thanks [/edit]
$header[0] = "Accept: text/xml,application/xml,application/xhtml+xml,";
$header[0].= "text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5";
$header[] = "Cache-Control: max-age=0";
$header[] = "Connection: keep-alive";
$header[] = "Keep-Alive: 300";
$header[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7";
$header[] = "Accept-Language: en-us,en;q=0.5";
$header[] = "Pragma: "; // browsers keep this blank.
then just user
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
No idea whether that will work for your problem but it's worth a go...
cheers,
hughie