Skip to main content
1 de 2
user avatar
user avatar

Tente assim com utf8_encode, porque pelo que você ta dizendo na sua tabela está a collation como latin1 e ocasiona esses caracteres estranhos.

header("Content-Type: application/rss+xml; charset=utf-8");

$rssfeed = '<?xml version="1.0" encoding="utf-8"?>';
$rssfeed .= '<rss version="2.0">';
$rssfeed .= '<channel>';
$rssfeed .= '<title>RSS feed</title>';
$rssfeed .= '<link>http://www.xxxxxxxxxxxxx.pt</link>';
$rssfeed .= '<description>RSS feed</description>';
$rssfeed .= '<language>en-us</language>';
$rssfeed .= '<copyright>Copyright (C) 2014 xxxxxxxxxxxxx.pt</copyright>';

$data = date("Y-m-d");
$query = "SELECT * FROM tbl_noticias WHERE data = '$data' ORDER BY id DESC";
$result = mysql_query($query) or die ("Could not execute query");

while($row = mysql_fetch_array($result)) {
    $title =  utf8_encode($row['titulo']);
    $title = utf8_encode($title);
    $description = utf8_encode($row['intro']);
    $date = $row['data']." - ".$row['hora'];
    $link = "http://www.xxxxxxxxxxxxx.pt/detalhe.php?id=".$row['id'];
    $image = "http://www.xxxxxxxxxxxxx.pt/images/resize_listagem/".$row['foto'];

    $rssfeed .= '<item>';
    $rssfeed .= '<title>' . $title . '</title>';
    $rssfeed .= '<description>' . $description . '<![CDATA[<br><img src="' . $image . '" />]]></description>';
    $rssfeed .= '<link>' . $link . '</link>';
    $rssfeed .= '<pubDate>' .$date. '</pubDate>';
    $rssfeed .= '</item>';
}
user6026