Skip to content
Permalink
Browse files

fixed iso-8859-1 encoding #318

  • Loading branch information...
oscarotero committed May 24, 2019
1 parent bc80c5d commit 5576cf67775c386e0843f3a4e05aa9da110e9c33
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Http/Response.php
@@ -74,7 +74,7 @@ public function getHtmlContent()
$content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=shift_jis">', $content);
} elseif (mb_detect_encoding($content, 'ISO-8859-1', true) === 'ISO-8859-1') {
$content = mb_convert_encoding($content, 'HTML-ENTITIES', 'ISO-8859-1');
$content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">', $content);
$content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">', $content);
}
$this->htmlContent->loadHTML(trim($content));

0 comments on commit 5576cf6

Please sign in to comment.
You can’t perform that action at this time.