The following code doesn't detect encoding correct.
$data = 'ABCDEG АБВГДЕ';
$charset = mb_detect_encoding($data);
$data = iconv($charset, "UTF-8", $data);
$data = mb_strtolower($data, 'UTF-8');
$datasort = str_replace(array("", "
", " "), '', $data);
$counter = mb_strlen($datasort,'UTF-8');
foreach (count_chars($datasort, 1) as $i => $val)
{
echo '
<tr>
<th scope="row">'.mb_detect_encoding(chr($i)).'</th>
// ON LATIN SYMBOLS IT DETECTED ANCII AND ON CYRILLIC IT DETECTED **NOTHING**
</tr>
';
}
Where here could be the problem? //php file have UTF-8 encoding