php-windows Digest 16 Aug 2013 03:38:06 -0000 Issue 4138

Topics (messages 31122 through 31124):

Re: php can't resolve 8.3 paths to unicode filenames, is that expected ?
        31122 by: Pierre Joye
        31123 by: R. S.
        31124 by: Pierre Joye

Administrivia:

To subscribe to the digest, e-mail:
        php-windows-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-windows-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-wind...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
hi!

On Wed, Aug 14, 2013 at 7:15 PM, R. S. <rs...@live.com> wrote:
> Hello Pierre,
>
> Wednesday, August 14, 2013, 10:27:24 AM, you wrote:
>
>> 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.
>
> Yes, I know that, and here COM has no issues with unicode.
>
> But in my example COM is irrelevant it is used only to get
> short path, to be sure that it leads to the unicode file.
> You can create unicode file on your own and then try
> to open it using short or long paths using any script you like.
> And you see that only PHP among all scripting languages in incapable
> of getting handle to such files. Even the software that doesn't know
> a byte about unicode is capable of doing that but not PHP.

Short paths work just fine. Not sure what goes wrong with the COM APIs
or this test script.

But:

$shortpath= 'TESTUN~1.PHP';
$handle = fopen($shortpath, 'w');

works just fine.

Cheers,
-- 
Pierre

@pierrejoye | http://www.libgd.org

--- End Message ---
--- Begin Message ---
Hello Pierre,

Thursday, August 15, 2013, 10:40:56 AM, you wrote:

> Short paths work just fine. Not sure what goes wrong with the COM APIs

Have you even read my example, or any of my posts before ?
There is nothing wrong with COM API, paradoxically COM works ok
and handles long and short paths just fine.
It is the php itself that has problem with them.

> or this test script.

> But:
> $shortpath= 'TESTUN~1.PHP';
> $handle = fopen($shortpath, 'w');
> works just fine.

I said short paths to *UNICODE* file names, windows has this feature that allows
apps that don't understand unicode to access these files and
all even old win311 programs and every scripting and programming
language I know can do that but not php.


--- End Message ---
--- Begin Message ---
hi,

On Thu, Aug 15, 2013 at 7:40 PM, R. S. <rs...@live.com> wrote:
> Hello Pierre,
>
> Thursday, August 15, 2013, 10:40:56 AM, you wrote:
>
>> Short paths work just fine. Not sure what goes wrong with the COM APIs
>
> Have you even read my example, or any of my posts before ?

yes.

> There is nothing wrong with COM API, paradoxically COM works ok
> and handles long and short paths just fine.
> It is the php itself that has problem with them.

it can read 8.3 paths, whether the path has an unicode or not
(actually they all have but not necessary contain unicode parts).

>> or this test script.
>
>> But:
>> $shortpath= 'TESTUN~1.PHP';
>> $handle = fopen($shortpath, 'w');
>> works just fine.
>
> I said short paths to *UNICODE* file names, windows has this feature that 
> allows
> apps that don't understand unicode to access these files and
> all even old win311 programs and every scripting and programming
> language I know can do that but not php.

and  'TESTUN~1.PHP' has unicode, created using CreateFileW with
'testunicode-ßäü123-öâ.php' as path. Fetch the 8.3 path and use it to
open the file using php, works. In other words. exactly what your COM
script does. Now, why you come to the conclusion that PHP can't open
8.3 path is a misery to me right now. It can and without issue.



-- 
Pierre

@pierrejoye | http://www.libgd.org

--- End Message ---

Reply via email to