How to solve the issue with encoding HtmlDomParser::file_get_html?

$dom_page_comments = HtmlDomParser::file_get_html(trim($link_comments), false, null, 0);
$wrap_comments = $dom_page_comments->find(".itemContent .company_column .comment");
...
$message = $comment->find(".first-text[itemprop='reviewBody']");
 if ($message){
 dd(trim(strip_tags($message[0]->innertext())));


that's what comes
5e281331a9348860258804.png

try here
$text = $message[0]->innertext();
$text = iconv("Windows-1251", "UTF-8//TRANSLIT", strip_tags(trim($text)));

the previous few comments, all is well and there is error because of not clear characters
5e281431eac70511195742.png

Put
$text = iconv("Windows-1251", "UTF-8//IGNORE//TRANSLIT", strip_tags(trim($text)));

helped a little but now some words are not clear
here
5e281b4b6ecc4572148499.png
April 4th 20 at 13:18
0 answer

Find more questions by tags PHP