UTF8_DECODE字符串中的错误解码(符号)

I'm developing a rss feed for my site. The problem becomes when I trying to decode the content, some characters are not decoded correctly.

This is my string on my row "html" in my table with utf8_spanish2_ci collation: I save data with utf8_encode.

<p style="text-align: center">Calidad: ⦠BRrip<br />Peso: ⦠693 Mb<br />Duración: ⦠1:33:09 Hs.<br />Codec video: ⦠Xvid<br />Formato: ⦠Avi<br />Resolución: ⦠640 x 272<br />Bitrate del video: ⦠904 Kbps<br />Frame rate: ⦠23.976 fps<br />Idioma: ⦠Español Latino<br />Codec Audio: ⦠MP3<br />Bitrate Audio: ⦠128 Kb/s 44100hz<br />Subtitulos: ⦠No Tiene</p>

The string Outputs: With utf8_decode, some characters are not decoded correctly

<p style="text-align: center">Calidad: �?� BRrip<br />Peso: �?� 693 Mb<br />Duración: �?� 1:33:09 Hs.<br />Codec video: �?� Xvid<br />Formato: �?� Avi<br />Resolución: �?� 640 x 272<br />Bitrate del video: �?� 904 Kbps<br />Frame rate: �?� 23.976 fps<br />Idioma: �?� Español Latino<br />Codec Audio: �?� MP3<br />Bitrate Audio: �?� 128 Kb/s 44100hz<br />Subtitulos: �?� No Tiene</p>

The string should be:

<p style="text-align: center">Calidad: … BRrip<br />Peso: … 693 Mb<br />Duración: … 1:33:09 Hs.<br />Codec video: … Xvid<br />Formato: … Avi<br />Resolución: … 640 x 272<br />Bitrate del video: … 904 Kbps<br />Frame rate: … 23.976 fps<br />Idioma: … Español Latino<br />Codec Audio: … MP3<br />Bitrate Audio: … 128 Kb/s 44100hz<br />Subtitulos: … No Tiene</p>

This is my complete code:

<?php
header('Content-Type: application/rss+xml; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?>';
echo "
<rss version='2.0'>";
echo "<channel>
";
echo "<title>Feed Juegos</title>
";
echo "<link>http://example.com</link>
";
echo "<description>Ultimas Entradas Xxx Javi</description>
";

        DEFINE ('USER', 'zadmin_new'); 
        DEFINE ('PWW', 'mierda');  
        DEFINE ('HOST_BD', 'localhost');  
        DEFINE ('DBNAME', 'zadmin_warezo'); 

        $conexion = mysql_connect(HOST_BD, USER, PWW) or  
        die ('No se pudo conectar a la BD');  
        mysql_select_db(DBNAME) or die ('Error in connection');  

        $query= "SELECT * FROM posts WHERE id_cat = 6 ORDER BY posts.fecha DESC LIMIT 0,18";
        $result = mysql_query($query) or die ('ERROR IN QUERY');  

        while ($fila = mysql_fetch_array($result, MYSQL_ASSOC))
        {
            $desc = $fila['html'];
            echo "<item>
";
            echo "<title>".$fila['titulo']."</title>
";
            echo "<link>http://example.com/peliculas-series/2/".$fila['id']."/".$fila['slug'].".html</link>
";  
            echo "<description>
".$desc."
</description>";          
            echo "</item>
";

        }  
    echo "</channel>";
    echo "</rss>";
?>

use htmlentities() and html_entity_decode() instead

store the text with the special characters after usinh htmlentities()

$text = htmlentities("çéà"); // resulting in $text = "&ccedil;&eacute;&agrave;";

After retriving it from the db just use html_entity_decode()

html_entity_decode($text); // resulting in çéà

no need for utf8 staff

hope this helps