- mb_detect_encoding: documentation ( source)
<?php
$str1 = "Jeanâ€Paul";
$str2 = "Jean-Paul";
$str3 = iconv(mb_detect_encoding($str2), mb_detect_encoding($str1), $str2);
if ($str3 == $str1) {
echo "equal";
} else {
echo $str3."|different|".$str1;
}