UTF-8 encoding bug on PHP older than 5.4

In PHP older than 5.4.0, the default charset for html_entity_decode(), htmlentities(), and htmlspecialchars() (less important) was ISO-8859-1, which creates erroneous UTF-8 characters.
Add explicit UTF-8 for these functions, as well as for PDO MySQL conexions.