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]

 



hi,

On Thu, Aug 1, 2013 at 6:41 PM, R. S. <rsk82@xxxxxxxx> wrote:
> Hello Anatol,
>
> Wednesday, July 31, 2013, 12:47:58 AM, you wrote:
>
>> 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 :)
>
> I tried this in python:
>
> filename = "e:\zzzzzzzzz_Ελλάδα.txt"
> a = open(filename, "w")
> a.write("this is a sample line\n")
> a.close()
> print(open(filename,"r").readline())
>
> Works fine. So I even if python has some problems on this line
> they aren't making it unusable for unicode file names.
>
> Even tried to run it with FreePascal with example from here:
> http://wiki.freepascal.org/File_Handling_In_Pascal - where I put shortened path
> since pascal also doesn't heard about unicode, and it works like charm.
>
> Now Perl:
> It also has problem with utf8, it successfully forces file with that encoding
> to be put on disk, resulting in working file with unreadable characters
> or images like arrows etc. (zzzzzzzzz_Ελλάδα.txt)
> but this works:
>
> open MYFILE, ">", "c:\\zzzzzz~2.txt";
> print MYFILE "Test line!\n";
>
>
> So every modern and not so modern language is able to handle somehow, at least
> making it usable to work with unicode filenames.
>
> Any challenge for me ? Give me any language that you think fail here like php ?

PHP does nothing with the paths a script passes to the IO function.
The only operation being done is to resolve relative paths and the
likes but that will only prepend the given path with the current
directory and remove ../.. part of the given paths.

The path is then given as is to the underlying OS file functions,
which work only with ANSI or the current system charset (CP-*). PHP
works perfectly fine with short path, even the ones with ~ in them.
The problem I can see here (but can't confirm as I do not have your
original source code to verify) is that the encoding seems to be UTF-8
and that won't work per se.

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).

Cheers,
-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

-- 
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