diff --git a/src/Query.php b/src/Query.php index ec6da1f..8ae0943 100644 --- a/src/Query.php +++ b/src/Query.php @@ -238,6 +238,7 @@ public function queryXpath($xpathQuery, $query = null, DOMNode $contextNode = nu $domDoc = new DOMDocument('1.0'); } else { $domDoc = new DOMDocument('1.0', $encoding); + $document = mb_convert_encoding($document, 'HTML-ENTITIES', $encoding); } $type = $this->getDocumentType(); switch ($type) {