Edit report at https://bugs.php.net/bug.php?id=65358&edit=1
ID: 65358
Comment 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: Duplicate
Type: Bug
Package: Filesystem function related
Operating System: Windows XP
PHP Version: 5.4.17
Block user comment: N
Private report: N
New Comment:
Yes, but there are different things to add support for full fledged unicode
names on windows and support only for shortened 8.3 dos paths that have no
unicode chars in them. I thought that such names would by completely
transparent to php like they are for 16 apps. This is not exact duplicate.
Previous Comments:
------------------------------------------------------------------------
[2013-07-30 16:48:43] [email protected]
This the general issue with non 7-bit encoded filenames, so duplicate of bug
#64699, see also bug #61315.
------------------------------------------------------------------------
[2013-07-30 11:12:52] rsk82 at live dot com
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.
------------------------------------------------------------------------
[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