Edit report at https://bugs.php.net/bug.php?id=61801&edit=1
ID: 61801 Updated by: cataphr...@php.net Reported by: lucas dot bocchi at gmail dot com Summary: Problem in htmlentities() -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: Linux Debian wheezy/sid PHP Version: 5.4.0 Block user comment: N Private report: N New Comment: Almost surely caused by change of default encoding to UTF-8 and the not being in UTF-8. To have pre-5.4 behavior set the encoding parameter to 'ISO-8859-1'. Previous Comments: ------------------------------------------------------------------------ [2012-04-21 20:10:21] lucas dot bocchi at gmail dot com Description: ------------ The first call of htmlentities works OK, but, the next call always return a empty string. When I print_r($res), all values are printed OK Test script: --------------- mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($database); $sql = "select noticia_id,noticia_datacad,noticia_assunto,noticia_titulo from tab_noticia order by noticia_data desc,categoria_id desc,noticia_id desc limit 15;"; $qry = mysql_query($sql); $res = mysql_fetch_row($qry); while ($res) { $title = htmlentities($res[3]); $subject = htmlentities($res[2]); $data = $res[1]; echo "\t\t\t\t\t<item>\r\n"; echo "\t\t\t\t\t\t<title>".$titulo."</title>\r\n"; echo "\t\t\t\t\t\t<description>".$assunto."</description>\r\n"; echo "\t\t\t\t\t\t<lastBuildDate>".$data."</lastBuildDate>\r\n"; echo "\t\t\t\t\t\t<link>http://www.the.site/news.php?id=".$id."</link>\r\n"; echo "\t\t\t\t\t</item>\r\n"; $res = mysql_fetch_row($qry); } // end while mysql_close(); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61801&edit=1