made all htmlspecialchars / htmlentities explicitly use UTF-8 encoding, as the default varies between PHP versions