Re: php can't resolve 8.3 paths to unicode filenames, is that expected ?
| From: | Pierre Joye | Date: | Wed, 14 Aug 2013 08:27:24 +0000 |
| Subject: | Re: php can't resolve 8.3 paths to unicode filenames, is that expected ? | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-31117@lists.php.net to get a copy of this message | ||
hi,
On Wed, Aug 14, 2013 at 9:09 AM, R. S. <rsk82@live.com> wrote:
> The code is provided in this thread and in my (dismissed)
> bug report.
>
> <?
> $FS = new \COM('Scripting.FileSystemObject', null, CP_UTF8);
> $FS->CreateTextFile("c:\\Ελλάδα.txt");
> $ShortPath = $FS->GetFile("c:\\Ελλάδα.txt")->ShortPath;
> echo $ShortPath;
> $handle = fopen($ShortPath, 'w');
> ?>
>
> Here the file is created trough COM as it is stated in source code.
> The com object isn't having any problem with translation from utf
> to encoding used with windows file systems.
COM is not PHP: You are calling the FileSystemObject's GetFile via COM
which uses unicode APIs under the hood. Nothing to do with PHP
streams.
>> Also UTF-8 (or the likes) paths for IO operation has nothing to very
>> little to do with Unicode support as described or tried in the never
>> released PHP 6. It is "only" about using another set of the Windows
>> file APIs, in very short, about using the <funcname>W ones instead of
>> the <funcname>A (which are aliases to <funcname> when UNICODE define
>> is not set).
>
> So this should be trivial to change in php's source code.
Not really, and not only in PHP code but all dependencies PHP uses.
--
Pierre
@pierrejoye | http://www.libgd.org