public static function fixUTF8($text) { if (is_array($text)) { foreach ($text as $k => $v) { $text[$k] = KomentoStringHelper::fixUTF8($v); } return $text; } $last = ""; while ($last != $text) { $last = $text; $text = KomentoStringHelper::forceUTF8(utf8_decode(KomentoStringHelper::forceUTF8($text))); } return $text; }