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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, July 30, 2013 00:25, R. S. wrote:
> 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 ?
>

This is a known issue with 8 bit filenames, please read here
https://bugs.php.net/bug.php?id=64699 . If you work with COM, why don't
you use it to get the file contents?

Regards

Anatol

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





[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux