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

I have read this node before, thank you nevertheless. What I was trying to do is to avoid the sheer horror of using Win32::API by nicely mapping these functions to readdir().

Replies are listed 'Best First'.
Re^3: unicode version of readdir
by almut (Canon) on Sep 15, 2007 at 14:01 UTC
    What I was trying to do is to avoid the sheer horror of using Win32::API by nicely mapping these functions to readdir().

    I think the only option you currently have which comes close to that is to enable the deprecated compile-time option USING_WIDE in win32.h in the Perl sources (which still works in 5.8.8, but won't any longer in 5.10). Also see Japanese filenames and USING_WIDE in win32.h, if you haven't come across this thread yet.

      I have, but USING_WIDE is removed from blead.
Re^3: unicode version of readdir
by zentara (Cardinal) on Sep 15, 2007 at 16:22 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".