Foros del Web » Programando para Internet » PHP »

Impresion de registro Mysql en Xml -> Feed

Estas en el tema de Impresion de registro Mysql en Xml -> Feed en el foro de PHP en Foros del Web. Tengo un problema con la impresion, los acentos y caracteres raros se guardan en formato html, y cuando lo imprimo en xml no aparece el ...
  #1 (permalink)  
Antiguo 06/09/2011, 07:13
Avatar de hackcrack  
Fecha de Ingreso: abril-2011
Mensajes: 331
Antigüedad: 13 años
Puntos: 9
Impresion de registro Mysql en Xml -> Feed

Tengo un problema con la impresion, los acentos y caracteres raros se guardan en formato html, y cuando lo imprimo en xml no aparece el caracter en si, sino su transformado en html. Poniendo htmlentities tampoco funciona. Probe con codificacion iso-8859-1 y utf8 pero sigue igual...
__________________
Los mejores juegos de PC gratis en ******
  #2 (permalink)  
Antiguo 06/09/2011, 07:57
Avatar de andresdzphp
Colaborador
 
Fecha de Ingreso: julio-2011
Ubicación: $this->Colombia;
Mensajes: 2.749
Antigüedad: 12 años, 9 meses
Puntos: 793
Respuesta: Impresion de registro Mysql en Xml -> Feed

adivino adivino donde estará el error? no hombre coloca el código.
__________________
Si sabemos como leer e interpretar el manual será mucho más fácil aprender PHP. En lugar de confiar en ejemplos o copiar y pegar - PHP
  #3 (permalink)  
Antiguo 06/09/2011, 07:57
Avatar de hackcrack  
Fecha de Ingreso: abril-2011
Mensajes: 331
Antigüedad: 13 años
Puntos: 9
Respuesta: Impresion de registro Mysql en Xml -> Feed

Lo solucione con esta clase que reemplaza los caracteres, aunque me gustaria algo que sea mas simplificado y directo..pero bue..

Cita:
function optimizar_texto($variable){
$variable = str_replace("á","á",$variable);
$variable = str_replace("é","é",$variable);
$variable = str_replace("í","í",$variable);
$variable = str_replace("ó","ó",$variable);
$variable = str_replace("ú","ú",$variable);
$variable = str_replace("Á","Á",$variable);
$variable = str_replace("É","É",$variable);
$variable = str_replace("Í","I",$variable);
$variable = str_replace("Ó","Ó",$variable);
$variable = str_replace("Ú","Ú",$variable);
$variable = str_replace("ñ","ñ",$variable);
$variable = str_replace("¡","¡",$variable);
$variable = str_replace("¿","¿",$variable);
$variable = str_replace("“","“",$variable);
$variable = str_replace("”","”",$variable);

return $variable;
}
Ahora tengro que eliminar los caracteres html ya que sino no funciona, segun parece :$
__________________
Los mejores juegos de PC gratis en ******
  #4 (permalink)  
Antiguo 06/09/2011, 07:59
Avatar de hackcrack  
Fecha de Ingreso: abril-2011
Mensajes: 331
Antigüedad: 13 años
Puntos: 9
Respuesta: Impresion de registro Mysql en Xml -> Feed

Cita:
Iniciado por andresdzphp Ver Mensaje
adivino adivino donde estará el error? no hombre coloca el código.
Jaja no puse el error porq crei que era algo generalizado, ya que vi que a muchos les pasaba lo mismo
__________________
Los mejores juegos de PC gratis en ******
  #5 (permalink)  
Antiguo 06/09/2011, 08:12
Avatar de hackcrack  
Fecha de Ingreso: abril-2011
Mensajes: 331
Antigüedad: 13 años
Puntos: 9
Respuesta: Impresion de registro Mysql en Xml -> Feed

bue..el html no era problema, agregue un par de nuevos caracteres, lo paso por si alguien lo necesita:

Cita:
function optimizar_texto($variable){
$variable = str_replace("á","á",$variable);
$variable = str_replace("é","é",$variable);
$variable = str_replace("í","í",$variable);
$variable = str_replace("ó","ó",$variable);
$variable = str_replace("ú","ú",$variable);
$variable = str_replace("Á","Á",$variable);
$variable = str_replace("É","É",$variable);
$variable = str_replace("Í","I",$variable);
$variable = str_replace("Ó","Ó",$variable);
$variable = str_replace("Ú","Ú",$variable);
$variable = str_replace("ñ","ñ",$variable);
$variable = str_replace("¡","¡",$variable);
$variable = str_replace("¿","¿",$variable);
$variable = str_replace("“","“",$variable);
$variable = str_replace("”","”",$variable);
$variable = str_replace("'","'",$variable);

return $variable;
}
__________________
Los mejores juegos de PC gratis en ******

Etiquetas: feed, html, impresion, mysql, registro, xml
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 11:45.