#47798 [NEW]: html_entity_decode not covering Z/z with caron for Windows-1252

[email protected] ("f4ckm5 at web dot de")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             f4ckm5 at web dot de
Operating system: Windows
PHP version:      5.2.9
PHP Bug Type:     Strings related
Bug description:  html_entity_decode not covering Z/z with caron for Windows-1252

Description:
------------
html_entity_decode should decode "LATIN CAPITAL LETTER Z WITH CARON"
&Zcaron; &#381; &#x17D; to (int)142, hex(8E) for Windows-1252
html_entity_decode should decode "LATIN SMALL LETTER Z WITH CARON"
&zcaron; &#382; &#x17E; to (int)158, hex(9E) for Windows-1252

htmlentities should encode the respective characters to &#381; and &#382;
(&zcaron; and &Zcaron; is not well supported by most browsers)

Reproduce code:
---------------
var_dump(html_entity_decode("&Zcaron;", ENT_QUOTES, "Windows-1252"));
var_dump(html_entity_decode("&#381;", ENT_QUOTES, "Windows-1252"));
var_dump(html_entity_decode("&#x17D;", ENT_QUOTES, "Windows-1252"));
var_dump(html_entity_decode("&zcaron;", ENT_QUOTES, "Windows-1252"));
var_dump(html_entity_decode("&#382;", ENT_QUOTES, "Windows-1252"));
var_dump(html_entity_decode("&#x17E;", ENT_QUOTES, "Windows-1252"));
var_dump(htmlentities(chr(142), ENT_QUOTES, "Windows-1252", true));
var_dump(htmlentities(chr(158), ENT_QUOTES, "Windows-1252", true));

Expected result:
----------------
string(1) "Ž"
string(1) "Ž"
string(1) "Ž"
string(1) "ž"
string(1) "ž"
string(1) "ž"
string(6) "&#381;"
string(6) "&#382;"

Actual result:
--------------
string(8) "&Zcaron;"
string(6) "&#381;"
string(7) "&#x17D;"
string(8) "&zcaron;"
string(6) "&#382;"
string(7) "&#x17E;"
string(1) "Ž"
string(1) "ž"


-- 
Edit bug report at http://bugs.php.net/?id=47798&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        http://bugs.php.net/fix.php?id=47798&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        http://bugs.php.net/fix.php?id=47798&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        http://bugs.php.net/fix.php?id=47798&r=trysnapshot60
Fixed in CVS:                        http://bugs.php.net/fix.php?id=47798&r=fixedcvs
Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=47798&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=47798&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=47798&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=47798&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=47798&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=47798&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=47798&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=47798&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=47798&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=47798&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47798&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47798&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=47798&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=47798&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=47798&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=47798&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=47798&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.