Note that there are some explanatory texts on larger screens.

plurals
  1. POUTF8_DECODE incorrect decode in string (symbols)
    primarykey
    data
    text
    <p>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.</p> <p>This is my string on my row "html" in my table with <code>utf8_spanish2_ci</code> collation: I save data with <code>utf8_encode</code>.</p> <pre><code>&lt;p style="text-align: center"&gt;Calidad: ⦠BRrip&lt;br /&gt;Peso: ⦠693 Mb&lt;br /&gt;Duración: ⦠1:33:09 Hs.&lt;br /&gt;Codec video: ⦠Xvid&lt;br /&gt;Formato: ⦠Avi&lt;br /&gt;Resolución: ⦠640 x 272&lt;br /&gt;Bitrate del video: ⦠904 Kbps&lt;br /&gt;Frame rate: ⦠23.976 fps&lt;br /&gt;Idioma: ⦠Español Latino&lt;br /&gt;Codec Audio: ⦠MP3&lt;br /&gt;Bitrate Audio: ⦠128 Kb/s 44100hz&lt;br /&gt;Subtitulos: ⦠No Tiene&lt;/p&gt; </code></pre> <hr> <p>The string Outputs: With <code>utf8_decode</code>, some characters are not decoded correctly</p> <pre><code>&lt;p style="text-align: center"&gt;Calidad: �?� BRrip&lt;br /&gt;Peso: �?� 693 Mb&lt;br /&gt;Duración: �?� 1:33:09 Hs.&lt;br /&gt;Codec video: �?� Xvid&lt;br /&gt;Formato: �?� Avi&lt;br /&gt;Resolución: �?� 640 x 272&lt;br /&gt;Bitrate del video: �?� 904 Kbps&lt;br /&gt;Frame rate: �?� 23.976 fps&lt;br /&gt;Idioma: �?� Español Latino&lt;br /&gt;Codec Audio: �?� MP3&lt;br /&gt;Bitrate Audio: �?� 128 Kb/s 44100hz&lt;br /&gt;Subtitulos: �?� No Tiene&lt;/p&gt; </code></pre> <hr> <p>The string should be:</p> <pre><code>&lt;p style="text-align: center"&gt;Calidad: … BRrip&lt;br /&gt;Peso: … 693 Mb&lt;br /&gt;Duración: … 1:33:09 Hs.&lt;br /&gt;Codec video: … Xvid&lt;br /&gt;Formato: … Avi&lt;br /&gt;Resolución: … 640 x 272&lt;br /&gt;Bitrate del video: … 904 Kbps&lt;br /&gt;Frame rate: … 23.976 fps&lt;br /&gt;Idioma: … Español Latino&lt;br /&gt;Codec Audio: … MP3&lt;br /&gt;Bitrate Audio: … 128 Kb/s 44100hz&lt;br /&gt;Subtitulos: … No Tiene&lt;/p&gt; </code></pre> <hr> <p>This is my complete code:</p> <pre><code>&lt;?php header('Content-Type: application/rss+xml; charset=utf-8'); echo '&lt;?xml version="1.0" encoding="utf-8"?&gt;'; echo "\n&lt;rss version='2.0'&gt;"; echo "&lt;channel&gt;\n"; echo "&lt;title&gt;Feed Juegos&lt;/title&gt;\n"; echo "&lt;link&gt;http://example.com&lt;/link&gt;\n"; echo "&lt;description&gt;Ultimas Entradas Xxx Javi&lt;/description&gt;\n"; 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 "&lt;item&gt;\n"; echo "&lt;title&gt;".$fila['titulo']."&lt;/title&gt;\n"; echo "&lt;link&gt;http://example.com/peliculas-series/2/".$fila['id']."/".$fila['slug'].".html&lt;/link&gt;\n"; echo "&lt;description&gt; ".$desc." &lt;/description&gt;"; echo "&lt;/item&gt;\n"; } echo "&lt;/channel&gt;"; echo "&lt;/rss&gt;"; ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload