Foros del Web » Programando para Internet » PHP »

problema con caracteres en rss

Estas en el tema de problema con caracteres en rss en el foro de PHP en Foros del Web. Hola amigos tengo este codigo que me muestra mal las tildes del title: Código PHP: <?php      header ( 'Content-Type: text/xml' );      echo  '<?xml version="1.0" encoding="ISO-8859-1"?>' ;            require_once( ...
  #1 (permalink)  
Antiguo 09/08/2010, 18:06
 
Fecha de Ingreso: abril-2010
Mensajes: 88
Antigüedad: 14 años
Puntos: 1
Pregunta problema con caracteres en rss

Hola amigos tengo este codigo que me muestra mal las tildes del title:

Código PHP:
<?php 
    header
('Content-Type: text/xml'); 
    echo 
'<?xml version="1.0" encoding="ISO-8859-1"?>'
     
    require_once(
"includes/usuariosenlinea/config.php");
        
    
$resultado mysql_query ("SELECT not_ID,titulo,texto,f_alta FROM noticias ORDER BY not_ID DESC"); 
     
     echo 
'<rss version="2.0"> 
    <channel> 
    <title>Asociación Musical CORO</title> 
    <link>http://www.micoro.org</link>
    <descripcion>Web Oficial del Coro</descripcion>'
;
    
function 
cut_string($string$charlimit)
{
if(
substr($string,$charlimit-1,1) != ' ')
{
$string substr($string,'0',$charlimit);
$array explode(' ',$string);
array_pop($array);
$new_string implode(' ',$array);

return 
$new_string.' ...';
}
else

return 
substr($string,'0',$charlimit-1).' ...';
}
}

    
while (
$row mysql_fetch_array ($resultado)) 
  {      
    echo 
"<item> 
    <title><![CDATA["
.utf8_decode($row['titulo'])."]]></title>
    <pubDate>"
.$row['f_alta']."</pubDate>
       <link>http://www.micoro.org/elcoro/noticias/mas.php?not_id="
.$row['not_ID']."</link> 
    <comments>http://www.micoro.org/elcoro/noticias/mas.php?not_id="
.$row['not_ID'].
</comments>
    <description><![CDATA["
.utf8_decode(cut_string($row['texto'],500))."]]></description>
    </item>"

    } 
echo 
'</channel> 
</rss>'

?>
este title es el que da el fallo: <title>Asociación Musical CORO</title>

sin embargo tengo el mismo codigo en otra web y funciona todo bien... :S ¿a que es debido?
  #2 (permalink)  
Antiguo 09/08/2010, 18:23
 
Fecha de Ingreso: abril-2010
Mensajes: 88
Antigüedad: 14 años
Puntos: 1
Respuesta: problema con caracteres en rss

no tengo ni idea de como ni porque... pero se a solucionado.... :S ajjajaj

Etiquetas: caracteres, rss
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 07:13.