In the windows
The file system is always UCS-2, unfortunately PHP is not that smart. I'm not sure if is_dir() comes down to calling an ANSI or WideString API, but it makes sense to go with ANSI. In this case, you are at the mercy of installing the Language for Non-Unicode OS. File names in the wrong languages ββwill not be available to you.
On linux
It's not so easy. The file system itself does not really have a specific text encoding, which makes things uncomfortable. The Cyrillic file name can be saved in UTF-8 or Windows-1252 (or something else), and it refers to software that creates / reads files to find out what the encoding is. The file system simply stores a bunch of bytes as a "file name". PHP also doesn't care about text encodings, so you really need to know what the encoding of the file name is in advance, so you can pass the correct string to is_dir() .
Finally
I highly recommend avoiding non-English characters in file names when using PHP. It's damn hard to understand.
Vilx- source share