htmlentities, htmlspecialchars and html_entity_decode have 3 parameters:
- string to be converted
but charset default is ISO-8859-1 and there’s no way to change that default, what happens if you’re porting 1,000,000 lines of code from ISO-8859-1 to UTF-8? you’ve to wrap those functions or patch every call passing all the 3 params. All these 2 solutions are bad solutions.
PHP should implement a customizable default, maybe also reading mbstring.internal_encoding if available.