Answer the question
In order to leave comments, you need to log in
Problem with encoding when reading files scandir (mb_convert_encoding, iconv) what's wrong?
Files with Russian names are uploaded to the server in a folder.
I read the folder with files and translate into the desired encoding:
header('Content-Type: text/html; charset= utf-8');
setlocale(LC_ALL,'ru_RU.UTF-8');
mb_internal_encoding("UTF-8");
$files = scandir('folder');
foreach($files as $v)
{
echo mb_convert_encoding($v, "UTF-8", "WINDOWS-1251");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question