in reply to Re^2: unicode version of readdir
in thread unicode version of readdir

Just as a zen hacking edu-guess, have you tried graff's method with some more win32-ish , like
@datafiles = grep { -f }, readdir( D ); $_ = decode( 'utf16le', $_ ) for ( @datafiles );

See also Can't Find File When Non-ASCII Letters Appear in Path


I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^4: unicode version of readdir
by dk (Chaplain) on Sep 15, 2007 at 21:56 UTC
    That only works if characters in filenames can be represented by the codepage. All other characters are replaced by question mark. Basically, this code from win32.c:

    WideCharToMultiByte(CP_ACP, WC_NO_BEST_FIT_CHARS, + wFindData.cFileName ... )

    does the conversion, and CP_ACP is (qoute from MSDN) "the current system Windows ANSI code page".