For perl, filenames are just byte streams, unless you explicitly configure perl to think differently of filenames. On 32 bit Windows (and I think also on 64 bit Windows), perl (both Strawberry and Activestate) is traditionally compiled as a legacy application calling the old "ANSI" API, not capable of handling Unicode (as far as I know). That's quite unfortunate. Perl can handle Unicode properly since at least 5.8.1, and most 32 Bit Windows variants have a Unicode API (all of those DLL exports ending with a "W"), unlike many other operating systems. (See also Re^7: any use of 'use locale'? (source encoding)).
Look what you get back from getSaveFile(). Dump the Unicode flag of $path, dump the length (if you get back a byte stream, the length exceeds the number of characters with your directory name), dump the character codes (ord()) of each character. Feel free to use some code from UChelp.pm, especially the dumpstr() function.
Compare that with what you get from a readdir() in C:\Documents and Settings\OT\Desktop.
Try to make some sense from that, try to convert what you get from getSaveFile() to what readdir() returned. Encode can help you with that.
Apart from that, every file on Win32 has two names (unless you change some settings). A "long" name that may contain white space and strange characters, and a "short" name that is restricted to DOS-compatible 8.3 notation and very few characters (a subset of ASCII, I think). Using the "short" name could help you.
Also look at the "W" functions of Win32API::File.
Alexander
In reply to Re: Perl path directory greek
by afoken
in thread Perl path directory greek
by welle
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |