Skip to content

Commit f16bc81

Browse files
authored
Merge pull request #212 from halityurttas/master
Need from encoding
2 parents 65da7d7 + 7a9a51c commit f16bc81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/PHPHtmlParser/Dom.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,11 @@ protected function clean(string $str): string
520520
}
521521
}
522522

523+
//sometime need predicate an encode is from encoding
524+
if ($this->options->get('useFromEncoding') != NULL) {
525+
$str = mb_convert_encoding( $str, "UTF-8", $this->options->get('useFromEncoding'));
526+
}
527+
523528
// remove white space before closing tags
524529
$str = \mb_eregi_replace("'\s+>", "'>", $str);
525530
if ($str === false) {

0 commit comments

Comments
 (0)