Edit report at https://bugs.php.net/bug.php?id=60675&edit=1
ID: 60675 Updated by: [email protected] Reported by: [email protected] Summary: htmlentities(ENT_COMPAT, windows-1251) for ISO-8859-1 encoded scripts -Status: Open +Status: Bogus Type: Bug Package: *General Issues Operating System: ubuntu 10.0.4 / lucid PHP Version: 5.4SVN-2012-01-06 (SVN) Block user comment: N Private report: N New Comment: htmlentities replaces characters with their *named* entities, for those characters that have it, with the exception of ' (apos): «This function is identical to htmlspecialchars() in all ways, except with htmlentities(), *all characters which have HTML character entity equivalents* are translated into these entities.» (doc for htmlentities(), emphasis mine) It is true that, for some encodings, htmlentities used to provide numerical entities for some characters. I removed such functionality because 1) it's inconsistent with the other encodings and 2) it was never documented behavior. Please remove the failing test you've added. Thanks! Previous Comments: ------------------------------------------------------------------------ [2012-01-06 22:11:00] [email protected] The test script is in PHP_5_4 and trunk as ext/standard/tests/strings/bug60675.phpt ------------------------------------------------------------------------ [2012-01-06 22:09:36] [email protected] Automatic comment from SVN on behalf of danielc Revision: http://svn.php.net/viewvc/?view=revision&revision=321841 Log: Test for bug 60675. ------------------------------------------------------------------------ [2012-01-06 22:08:47] [email protected] Automatic comment from SVN on behalf of danielc Revision: http://svn.php.net/viewvc/?view=revision&revision=321840 Log: Test for bug 60675. ------------------------------------------------------------------------ [2012-01-06 21:58:01] [email protected] Description: ------------ The behavior htmlentities() (or PHP's parser/whatever) has changed between 5.3 and 5.4. I will put a phpt file in svn once the bug number is known. Test script: --------------- $in = 'Ãåñòèðóåì'; echo htmlentities($in, ENT_COMPAT, 'windows-1251'); Expected result: ---------------- Тестируем Actual result: -------------- illegible ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60675&edit=1
