Re: php can't resolve 8.3 paths to unicode filenames, is that expected ?

"R. S." <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <[email protected]>
Hello Anatol,

Wednesday, July 31, 2013, 12:47:58 AM, you wrote:

> Warning: fopen(ZZZZZZ~1.TXT): failed to open stream: Invalid argument in
> Command line code on line 1
> bool(false)

Yes, but how does the function even know that there are multibyte
in it's arguments ? Since it was given the ascii compliant name ?
And why 16 bit apps don't experience any errors since they are much
older than php ? Maybe because they are ignorant about multibyte paths ?
Shouldn't php be ignorant too if it can't handle it ?

> The file without multibyte chars in the name can be opened. Also, do you
> notice that question marks in the other filename?

Yes, but there are no question marks in shortenened path.

> Those have to be handled.

But how the php function does know about that ?
Now I tried to open that greek file in old msdos 622 and it worked
without any issue. Although I know it will mess it name if I try to
change it. And I expect the same from php. But I don't want here
to rename anything in php.

> Despite of how good the other old and new programs are, PHP
> doesn't support this at the moment.

So it should and it is a bug. And it is the two different things if 
I want you to make PHP Unicode complying, which I do not.
I want you to make php completely ignorant of unicode paths
as are the old 20 yo apps until it will be able to 100% successfully handle it.

> As a dessert I'd suggest you to read this ticket from not very recent past
> about how it's going in python http://bugs.python.org/issue13247 :)
under Windows, os.path.abspath returns non-ASCII bytes paths as question marks
but what you need abspath for ? and why php filesystem functions need 
to know absolute path ?


another thing I noticed is that php doesn't as I thought try to translate the path, if I give it
the one without unicode I get back it in the same shortened form
so what is happening here ? it doesn't give the user absolute path but it must
be using it somewhere internally

<?
$FS = new \COM('Scripting.FileSystemObject', null, CP_UTF8);
$FS->CreateTextFile("c:\\zzzzzzzzz_ellada.txt");
$ShortPath = $FS->GetFile("c:\\zzzzzzzzz_ellada.txt")->ShortPath;
echo "short path: ".$ShortPath."\n";
$handle = fopen($ShortPath, 'r');
echo "handle path: ".stream_get_meta_data($handle)['uri']."\n";
// echoes: C:\ZZZZZZ~2.TXT
?>


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.