fix htmlentities encoding