Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Directory operations and Unicode

by moritz (Cardinal)
on Nov 02, 2011 at 10:40 UTC ( #935349=note: print w/ replies, xml ) Need Help??


in reply to Directory operations and Unicode

The problem is that Win32 seems to be the only platform that offers an Unicode-aware file system API.

On Linux, file names are zero-byte terminated binary strings, the interpretation is left to the userland. One can guess based on the locale, or just assume something globally, but neither approach is robust.

So perl continues to offer an experience that is equally bad on Unix and Win32. I'm not aware of any changes to this (planned or released), but them I'n not up to date with p5p either.


Comment on Re: Directory operations and Unicode
Replies are listed 'Best First'.
Re^2: Directory operations and Unicode
by afoken (Prior) on Nov 02, 2011 at 11:13 UTC
    The problem is that Win32 seems to be the only platform that offers an Unicode-aware file system API.

    And as far as I know, all perls compiled for Windows still use the "ANSI" API to access the file system (i.e. CreateFileA instead of CreateFileW). Completely switching Perl to use the "wide" API may have "interesting" side effects. A very obvious one would be readdir returning Unicode strings instead of byte strings. Will existing code be able to handle that?

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

      And even if you make the wide character API only available with a pragma, you still need separate calling code for Windows and Unix, which was mostly my point.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935349]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2015-07-31 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (281 votes), past polls