Skip to content

Commit 7a9a51c

Browse files
committed
Need from encoding
Add options param is useFromEncoding therefore predicate an encode is from encoding
1 parent 668c770 commit 7a9a51c

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
@@ -527,6 +527,11 @@ protected function clean(string $str): string
527527
}
528528
}
529529

530+
//sometime need predicate an encode is from encoding
531+
if ($this->options->get('useFromEncoding') != NULL) {
532+
$str = mb_convert_encoding( $str, "UTF-8", $this->options->get('useFromEncoding'));
533+
}
534+
530535
// remove white space before closing tags
531536
$str = mb_eregi_replace("'\s+>", "'>", $str);
532537
if ($str === false) {

0 commit comments

Comments
 (0)