note 117078 deleted from function.mb-convert-encoding by tularis
| From: | tularis@php.net | Date: | Sun, 12 Apr 2015 20:38:11 +0000 |
| Subject: | note 117078 deleted from function.mb-convert-encoding by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-202238@lists.php.net to get a copy of this message | ||
Note Submitter: stangerroman at gmail dot com
----
Russian symbols.
I used scandir() to get a directory content. It had files with english and russian names.
The original structure:
Guide.txt
УÑебник.txt
I used this code:
<?php
$path="C:/Documents/test";
$list=scandir($path);
$list=join("\n",$list);
echo "<pre>".$list."</pre>";
?>
And the result was:
Guide.txt
�������.txt
So I used the CP1251 or Windows-1251 encoding:
<?php
$list=mb_convert_encoding($list, "utf-8", "cp1251");
?>
So the result showed in english and russian.