Skip to content

Commit 026611c

Browse files
committed
Remove redundant UTF-8 charset normalization in Parser
1 parent 7dc22d9 commit 026611c

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/PHPHtmlParser/Dom/Parser.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ public function detectCharset(Options $options, string $defaultCharset, Abstract
146146
$charset = trim($matches[1]);
147147
// Normalize charset names
148148
$charset = strtoupper($charset);
149-
if ($charset === 'UTF-8') {
150-
$charset = 'UTF-8';
151-
}
152149

153150
$encode->setSourceEncoding($charset);
154151
$root->propagateEncoding($encode);
@@ -256,9 +253,6 @@ private function detectHTML5Charset(EncoderInterface $encode, AbstractNode $root
256253
$charset = trim($meta->getAttribute('charset'));
257254
// Normalize charset names
258255
$charset = strtoupper($charset);
259-
if ($charset === 'UTF-8') {
260-
$charset = 'UTF-8';
261-
}
262256

263257
$encode->setSourceEncoding($charset);
264258
$root->propagateEncoding($encode);

0 commit comments

Comments
 (0)