From 38984b5bbaf6e86e40569815dd53cc18ad09578f Mon Sep 17 00:00:00 2001 From: Aleksandr Ivanov Date: Thu, 16 Nov 2017 18:03:57 +0300 Subject: [PATCH] Replace text encoding function Changed encoding function in convert_text. There was iconv, but now is mb_convert_encoding. It needs, because when we pass HTML in UTF-8 during creating instance of simple_html_dom and target character set windows-1251 and want to get some text through ->text() sometimes we catch an error "iconv(): Detected an illegal character in input string". --- Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php index 279d589..0242937 100644 --- a/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php +++ b/Src/Sunra/PhpSimple/simplehtmldom_1_5/simple_html_dom.php @@ -800,7 +800,7 @@ function convert_text($text) } else { - $converted_text = iconv($sourceCharset, $targetCharset, $text); + $converted_text = mb_convert_encoding($text, $targetCharset, $sourceCharset); } }