in reply to Re: Problems Opening file with Perl where path has UTF8 (sorry)
in thread Problems Opening file with Perl where path has UTF8

What about FindFirstFileW() (also not in Win32API::File) unfortunately, for opening directories in UTF-8? In perl's win32/win32.c - win32_open has deprecated USING_WIDE(), so there's no real option at this point. :( I'd really like to see File::Find work on Win32 with UTF-8 filenames & dirs. Thanks
  • Comment on Re^2: Problems Opening file with Perl where path has UTF8 (sorry)

Replies are listed 'Best First'.
Re^3: Problems Opening file with Perl where path has UTF8 (FindFirstFile)
by tye (Sage) on Nov 23, 2006 at 19:35 UTC

    FindFirstFileA() isn't even in Win32API::File. Unfortunately, the complex structs used makes it less trivial to add; but I'll look into that. But that wouldn't help File::Find much. Better would be to fix readdir (and thus glob, I'd hope) on Win32 to use FindFirstFileW() and return UTF-8 file names only if the found files have names with non-8-bit characters in them (or perhaps non-7-bit characters), or perhaps do things backward compatably based on something in %ENV (well, I prefer using %ENV over some obscure internal Perl variable because I find such preferences easier to deploy).

    - tye        

      Yeah, readdir() needs work too.

      Anything that would help - I'm completely unable to read UTF-8 files on Windows right now.

      Thanks