Skip to content

Commit a20d711

Browse files
committed
ignored only utf
1 parent 56d5a6c commit a20d711

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Http/Response.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ public function getHtmlContent()
6161
$entities = libxml_disable_entity_loader(true);
6262

6363
$this->htmlContent = new DOMDocument();
64-
if (stripos($content, '<meta charset=') === false) {
64+
65+
if (stripos($content, '<meta charset="utf') === false) {
6566
$encodings = [
6667
'ASCII' => 'ascii',
6768
'UTF-8' => 'utf-8',
@@ -86,7 +87,7 @@ public function getHtmlContent()
8687
];
8788

8889
$detected = mb_detect_encoding($content, implode(',', array_keys($encodings)), true);
89-
90+
9091
if ($detected && !empty($encodings[$detected])) {
9192
$content = mb_convert_encoding($content, 'HTML-ENTITIES', $detected);
9293
$content = preg_replace(

0 commit comments

Comments
 (0)