Windows provides two interface ("A" and "W"), and Perl uses the one where file names have to be encoded using the current (OEM) code page. That would be the same as on unix, except Windows's UTF-8 support sucks. Switching your console to the UTF-8 cp gives all kinds of problems.
Perl does have great support for UCS-2le. That's what it uses internally. You can use the "W" interface to work with this encoding. This gives access to the full range of characters supported by Windows. It's what you have to use to create files with names that lie outside your code page.
In short, Perl uses a unix-centric approach, so you have to go outside the box on Windows.
Decode the file name from whatever encoding your source uses, encode it using UTF-16le, get a system handle to the file using Win32API::File's "W" functions, convert it to a Perl file using the function provided by the same module, then stat the handle.
Update: Fleshed out details.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.