Hi. I'm new in flickr api, and i'm still looking around to better
understand how it works.

I'm working with PHP and I have a problem with special chars. I send
to twitter a request like this:

$url = "http://twitter.com/statuses/friends_timeline.xml";;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, "username:password");
$result = curl_exec($ch);
curl_close($ch);

Then I handle the result with something like this:

$xml = simplexml_load_string($result);
foreach ($xml->status as $status) {
  $image = $status->user->profile_image_url;
  $name = $status->user->screen_name;
  $icon = '<img src="' . $image . '" title="' . $name . '"
align="middle" />';
  $text = $status->text;
  echo "<p>" . $icon . " " . $text . "</p>\n";
}

The problem is in special chars. If I wrote (in italian) the following
text:

"Il mio nome è Carlo"

the API returns something like:

"Il mio nome À Carlo"

I used PHP function htmlspecialchars(), but with no success.

Can anybody help me?

Thanks a lot
Carlo

Reply via email to