Skip to content

Commit 5f71e6c

Browse files
committed
Set default encoding in case it does not exist.
1 parent 239e937 commit 5f71e6c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/HTML5/Parser/DOMTreeBuilder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public function __construct($isFragment = false, array $options = array())
176176
$dt = $impl->createDocumentType('html');
177177
// $this->doc = \DOMImplementation::createDocument(NULL, 'html', $dt);
178178
$this->doc = $impl->createDocument(null, null, $dt);
179+
$this->doc->encoding = !empty($options['encoding']) ? $options['encoding'] : 'UTF-8';
179180
}
180181

181182
$this->errors = array();

0 commit comments

Comments
 (0)