We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 137d9a9 + aa2829e commit ec7a635Copy full SHA for ec7a635
src/Document.php
@@ -30,7 +30,7 @@ public function __construct(Extractor $extractor)
30
$contentType = $extractor->getResponse()->getHeaderLine('content-type');
31
preg_match('/charset="?(.*?)(?=$|\s|;|")/i', $contentType, $match);
32
if (!empty($match[1])) {
33
- $encoding = $match[1];
+ $encoding = trim($match[1], ',');
34
} elseif (!empty($html)) {
35
preg_match('/charset="?(.*?)(?=$|\s|;|")/i', $html, $match);
36
0 commit comments