From a44e97a84f9c41b33e2c6becab7d2fd0aae9d3fe Mon Sep 17 00:00:00 2001 From: mattpass Date: Mon, 3 Feb 2020 10:26:51 +0000 Subject: [PATCH] Change iconv to mb_convert_encoding --- lib/settings-common.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/settings-common.php b/lib/settings-common.php index 838a848..27853fa 100644 --- a/lib/settings-common.php +++ b/lib/settings-common.php @@ -247,9 +247,7 @@ function toUTF8noBOM($string,$message=false) { // Test for any bad characters $teststring = $string; $teststringBroken = utf8_decode($teststring); - $teststringConverted = function_exists("iconv") - ? iconv("UTF-8", "UTF-8//IGNORE", $teststringBroken) - : $teststringBroken; + $teststringConverted = mb_convert_encoding($teststringBroken, "UTF-8"); // If we have a matching length, UTF8 encode it if (!$strictUTF8 && strlen($teststringConverted) == strlen($teststringBroken)) { $string = utf8_encode($string);