php - Is the third htmlspecialchars parameter ($encoding) case-sensitive? -
i came across user-contributed note (upvoted 7 times) on php manual page htmlspecialchars has me confused.
be careful, "charset" argument case sensitive. counter-intuitive , serves no practical purpose because html spec has opposite.
now, realize there no difference between iso-8859-1, iso-8859-15, utf-8, cp866, cp1251, cp1252, , koi8-r purposes of htmlspecialchars
.
but had me wondering htmlentities
, html_entity_decode
since have same parameters. i'm on php 5.3 default iso-8859-1. did testing windows-1252, windows-1252, utf-8, , utf-8. in cases, got expected results characters exist in tested character set.
so wondered whether or not note
- applies versions
- applies htmlspecialchars
- is wrong
i tried digging source, couldn't find way around. i'm concerned behavior of html_entity_decode
across different versions because use convert user-supplied html plain text.
Comments
Post a Comment