Bug #70903 [Opn]: scandir wrongly interprets the Turkish "ı" character
| From: | cmb@php.net | Date: | Mon, 13 Jun 2016 22:53:10 +0000 |
| Subject: | Bug #70903 [Opn]: scandir wrongly interprets the Turkish "ı" character | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-201581@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70903&edit=1
ID: 70903
Updated by: cmb@php.net
Reported by: eparlakay at hotmail dot com
Summary: scandir wrongly interprets the Turkish "ı"
character
Status: Open
Type: Bug
Package: *Directory/Filesystem functions
Operating System: Windows 7 Enterprise
PHP Version: 7.0.0RC7
Block user comment: N
Private report: N
New Comment:
Apparently, the issue is already with scandir(). var_dump'ing its
result (PHP 7.0.7, German Windows 10):
array(4) {
[0]=>
string(1) "."
[1]=>
string(2) ".."
[2]=>
string(4) "Asli"
[3]=>
string(4) "Asli"
}
While dir(1) reports:
14.06.2016 00:33 <DIR> .
14.06.2016 00:33 <DIR> ..
14.06.2016 00:31 <DIR> Asli
14.06.2016 00:31 <DIR> Aslı
Previous Comments:
------------------------------------------------------------------------
[2015-12-19 01:45:17] ajf@php.net
I suspect this is an issue with Windows's filesystem case handling and not PHP itself.
Could you try the Command Prompt and see how it responds here?
------------------------------------------------------------------------
[2015-11-12 23:33:14] eparlakay at hotmail dot com
Correcting a typo error in actual result:
Folder is created
Warning: mkdir(): File exists in C:\testingScandir.php on line 6
ERROR for Asli:
------------------------------------------------------------------------
[2015-11-12 23:30:13] eparlakay at hotmail dot com
Description:
------------
Scandir function wrongly interprets the Turkish "ı" (i without dot) character. It
interprets the "ı" as "i".
For the test script, assume there are two directories in a folder:
c:\Music\
|
| Aslı
| Asli
Test script:
---------------
<?php
$FILES = scandir("C:\\Music\\");
foreach($FILES as $k=>$v)
{
if(!mkdir("c:\\TEST\\".$v))
{
echo "ERROR for ".$v."\n";
}
else
{
echo "Folder is created\n";
}
}
?>
Expected result:
----------------
Folder is created
Folder is created
Actual result:
--------------
Folder is created
Warning: mkdir(): File exists in C:\testingScandir.php on line 6
ERROR for Sila:
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70903&edit=1