cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: unicode character transport + decoding problems

From: Brian Lucas <blucasco_at_gmail.com>
Date: Tue, 22 Feb 2005 12:02:05 -0700

I wasn't sure if anybody had taken a look at this issue, but I was
still looking for any ideas people might have where my text encoding
is getting screwed up -- is it a curl header issue or is php mangling
the multi-byte variable somehow?

All I want to know is if anybody can grab a feed like
http://www.tamiloviam.com/newsfeed/writerpara.xml and display it
properly on their browser. I also tried setting the same headers I
received from LiveHTTPHeaders into curl and still can't pull it.

simple test code below:

<?php

$url ="http://www.tamiloviam.com/newsfeed/writerpara.xml";
$ch = curl_init(); // initialize curl handle

curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (X11; U; FreeBSD
i386; en-US; rv:1.2a) Gecko/20021021");

curl_setopt($ch, CURLOPT_URL,$url); // set url to post to

curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable

curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Charset:
ISO-8859-1,utf-8;q=0.7,*;q=0.7'));

$result = curl_exec($ch); // run the whole process

echo $result; //contains response from server
?>
Received on 2005-02-22