The thing is these paths do not have any non ascii chars in them. Old 16b 
win311 apps are perfectly fine with such files, they just can't correctly show 
their name nor create a fresh file with non ascii name. And such behavior I was 
expecting from php.


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

error:
Warning: file_get_contents(C:\BFEE~1.TXT): failed to open stream: Invalid 
argument in C:\test.php on line 12

I think somewhere down the rabbit hole the function tries to recreate original 
path and then gets confused.

Is there any way around it ? Like creating a handle from a COM object, or a 
separate protocol like in file_get_contents("php://stdin"), or whatever to pass 
it to the fopen() so php won't see the offending name ?


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to