in reply to unicode version of readdir

These nodes might help

Win32 API directory searches that return wide / unicode filenames

Unicode in filenames (part 2)


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

Replies are listed 'Best First'.
Re^2: unicode version of readdir
by dk (Chaplain) on Sep 15, 2007 at 13:34 UTC
    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().
      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.
        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".