|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-07-18 15:57 UTC] andrelisci at gmail dot com
Description:
------------
when accented characters are found inside a string, htmlentities return empty string
this doesn't happen on php old versions
Test script:
---------------
<?php
print "-->".htmlentities("test ì")."<--\n";
print "-->".htmlentities("test à")."<--\n";
print "-->".htmlentities("test ò")."<--\n";
print "-->".htmlentities("test ù")."<--\n";
print "-->".htmlentities("test è")."<--\n";
print "-->".htmlentities("test é")."<--\n";
?>
Expected result:
----------------
-->test ì<--
-->test à<--
-->test ò<--
-->test ù<--
-->test è<--
-->test é<--
Actual result:
--------------
--><--
--><--
--><--
--><--
--><--
--><--
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 15:00:01 2026 UTC |
Adding optional params 'quote_style' and 'charset' solves the problem print "-->".htmlentities("test ì",ENT_COMPAT,"ISO-8859-1")."<--\n"; will output -->test ì<--