Re: is_file and file_exists not case sensitive?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 21.03.2020 at 13:28, Lester Caine wrote:

> On 21/03/2020 09:25, Christoph M. Becker wrote:
>
>> On 21.03.2020 at 02:37, Andrey Repin wrote:
>>
>>> That's not really true. Windows can be configured for anything you
>>> wish, and
>>> UNICODE names were a problem of PHP, which was solved
>>> not-very-recently in V7.
>>
>> More precisely, as of PHP 7.1.0:
>> <https://www.php.net/manual/en/migration71.windows-support.php#migration71.windows-support.long-and-utf8-path>.
>
> But is far as I am aware windows is STILL using 16 bit per character
> wide string format for file names along with somewhat unreliable case
> conversions on the basic ASCII character subset? While we can use UTF8
> characters in Linux file names they do not map through to the windows
> file name? This is nothing to do with PHP ... we just have to work out
> how to live with it ...

Windows (NTFS) uses UTF-16 encoded file names.  However, the PHP stream
layer transparently converts from and to UTF-8 as needed (and for other
encodings respective INI directives can be used).  So except for some
functions which don't use the PHP stream layer (yet), UTF-8 conforming
applications should work on Windows without issues.

And to be clear, before PHP 7.1.0 it was not necessarily possible to
work around that, because internally ANSI APIs have been used (instead
of their wide character pendants), so only characters which could be
encoded in the process' codepage could be used for filenames.

See
<https://github.com/php/php-src/commit/3d3f11ede4cc7c83d64cc5edaae7c29ce9c6986f#diff-0ec01856e24b69c58dee291fa611db9f>
for further details.

--
Christoph M. Becker




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux