Commit f45a1152 authored by Andrew Dolgov's avatar Andrew Dolgov

af_readability: force utf8 preamble on html document load. no idea why but it...

af_readability: force utf8 preamble on html document load. no idea why but it seems to work better even for not-unicode sites.
parent 24c7e413
......@@ -162,7 +162,7 @@ class Af_Readability extends Plugin {
if ($tmp && mb_strlen($tmp) < 1024 * 500) {
$tmpdoc = new DOMDocument("1.0", "UTF-8");
if (!$tmpdoc->loadHTML($tmp))
if (!$tmpdoc->loadHTML('<?xml encoding="utf-8" ?>\n' . $tmp))
return false;
if (strtolower($tmpdoc->encoding) != 'utf-8') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment