mb_detect_encoding()
is normally useless with the default second parameter:
<?php
$x1 = 'Cl%C3%A9ment';
$x2 = 'Cl%E9ment';
$encoding_list = array('utf-8', 'iso-8859-1');
var_dump(
mb_detect_encoding(urldecode($x1), $encoding_list),
mb_detect_encoding(urldecode($x2), $encoding_list)
);
... prints:
string(5) "UTF-8"
string(10) "ISO-8859-1"