Skip to content

Commit

Permalink
Set default encoding in case it does not exist.
Browse files Browse the repository at this point in the history
  • Loading branch information
idimopoulos committed Jun 14, 2019
1 parent 239e937 commit 5f71e6c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/HTML5/Parser/DOMTreeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public function __construct($isFragment = false, array $options = array())
$dt = $impl->createDocumentType('html');
// $this->doc = \DOMImplementation::createDocument(NULL, 'html', $dt);
$this->doc = $impl->createDocument(null, null, $dt);
$this->doc->encoding = !empty($options['encoding']) ? $options['encoding'] : 'UTF-8';
}

$this->errors = array();
Expand Down

0 comments on commit 5f71e6c

Please sign in to comment.