Prepare UTF-8 characters for DOMDocument (Fixes #768)

DOMDocument::loadHTML() assumes the document is encoded with
ISO-8859-1 unless otherwise specified. However, due to some quirks
in processing DOMDocument doesn't always adhere to the specified
encoding. Translating the HTML to HTML-ENTITIES appears to fix the
issue munging characters.