PHP 5.3 htmlentities() defaults to ISO-8859-1 and 5.4 defaults to UTF-8. Force to UTF-8 always.