diff --git a/src/JSLikeHTMLElement.php b/src/JSLikeHTMLElement.php
index 3f382e1..bb5c9ea 100644
--- a/src/JSLikeHTMLElement.php
+++ b/src/JSLikeHTMLElement.php
@@ -79,14 +79,13 @@ class JSLikeHTMLElement extends \DOMElement
} else {
// $value is probably ill-formed
$f = new \DOMDocument();
- $value = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
// Using will generate a warning, but so will bad HTML
// (and by this point, bad HTML is what we've got).
// We use it (and suppress the warning) because an HTML fragment will
// be wrapped around tags which we don't really want to keep.
// Note: despite the warning, if loadHTML succeeds it will return true.
- $result = $f->loadHTML('' . $value . '');
+ $result = $f->loadHTML('' . $value . '');
if ($result) {
$import = $f->getElementsByTagName('htmlfragment')->item(0);
diff --git a/src/Readability.php b/src/Readability.php
index 8c1e62b..08963c0 100644
--- a/src/Readability.php
+++ b/src/Readability.php
@@ -1430,7 +1430,7 @@ class Readability implements LoggerAwareInterface
unset($tidy);
}
- $this->html = mb_convert_encoding($this->html, 'HTML-ENTITIES', 'UTF-8');
+ $this->html = '' . (string) $this->html;
if ('html5lib' === $this->parser || 'html5' === $this->parser) {
$this->dom = (new HTML5())->loadHTML($this->html);