- var_dump: documentation ( source)
- mb_detect_encoding: documentation ( source)
- urldecode: documentation ( source)
<?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)
);