af_readability: force utf8 preamble on html document load. no idea why but it seems to work better even for not-unicode sites.
This commit is contained in:
parent
24c7e4132d
commit
f45a1152bb
1 changed files with 1 additions and 1 deletions
|
@ -162,7 +162,7 @@ class Af_Readability extends Plugin {
|
||||||
if ($tmp && mb_strlen($tmp) < 1024 * 500) {
|
if ($tmp && mb_strlen($tmp) < 1024 * 500) {
|
||||||
$tmpdoc = new DOMDocument("1.0", "UTF-8");
|
$tmpdoc = new DOMDocument("1.0", "UTF-8");
|
||||||
|
|
||||||
if (!$tmpdoc->loadHTML($tmp))
|
if (!$tmpdoc->loadHTML('<?xml encoding="utf-8" ?>\n' . $tmp))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (strtolower($tmpdoc->encoding) != 'utf-8') {
|
if (strtolower($tmpdoc->encoding) != 'utf-8') {
|
||||||
|
|
Loading…
Reference in a new issue