Edit report at https://bugs.php.net/bug.php?id=65358&edit=1

 ID:                 65358
 User updated by:    rsk82 at live dot com
 Reported by:        rsk82 at live dot com
 Summary:            php can't handle 8.3 names of files which have long
                     names with unicode in them
 Status:             Open
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Windows XP
 PHP Version:        5.4.17
 Block user comment: N
 Private report:     N

 New Comment:

Functions affected are not only fopen, but all, no matter if writing or reading 
the file.

And I think it is and issue in all of the php versions in windows not only 5.4.


Previous Comments:
------------------------------------------------------------------------
[2013-07-30 11:09:49] rsk82 at live dot com

Description:
------------
I don't know if this is expected. I know that php can't handle international 
file names in Windows but shortened paths have no Unicode characters in them so 
I do not see any reason that php should have any problem with that.

These paths are perfectly visible to 16bit win311 apps and such files are 
editable by those programs, of course them cannot see the correct name of the 
file but this doesn't count any problem with accessing their content. And if 
that I think php should have similar behavior here.

Maybe the php's filesystem functions are trying to "do better" and translate 
such path to it's normal mode and subsequently are confused about what they 
have done.

Test script:
---------------
    <?
    $FS = new \COM('Scripting.FileSystemObject', null, CP_UTF8);
    $FS->CreateTextFile("c:\\Ελλάδα.txt");
    $ShortPath = $FS->GetFile("c:\\Ελλάδα.txt")->ShortPath;
    echo $ShortPath;
    $handle = fopen($ShortPath, 'w');
    ?>

Expected result:
----------------
The script should run without any errors.

Actual result:
--------------
Warning: fopen(C:\BFEE~1.TXT): failed to open stream: Invalid argument in 
C:\test.php on line 6


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65358&edit=1

Reply via email to