RE: Win32 API, Directories with Unicode / Wide Filenames, FindFir stFileW, FindNextFileW

2006-01-26 Thread Konovalov, Vadim
> I have a Win32 Perl coding challenge to search a directory > (WinXP, NTFS) > with a file specification pattern where the directory may > contain files > with unicode / wide filenames in addition to ANSI filenames. > Through > trial, error, and searches against Perl mailing list > archive

Re: Win32 API, Directories with Unicode / Wide Filenames, FindFirstFileW, FindNextFileW

2006-01-26 Thread Reini Urban
The easiest fix would be to use a perl which is using the W (wide) string functions and not the A, as ActivePerl does. And then recompile libwin32. I'm also fighting with the same issue on Win32::GUI (japanese and proper umlauts) with UCS-2 encoded strings. 2006/1/25, Dewey Allen <[EMAIL PROTECTE

RE: Win32 API, Directories with Unicode / Wide Filenames, FindFir stFileW, FindNextFileW

2006-01-26 Thread Konovalov, Vadim
you're right, and, if you need to deal with unicode in file names, you do something like this: use Win32::OLE qw(in CP_UTF8); use Win32::OLE::Const; Win32::OLE->Option(CP=>CP_UTF8); use Unicode::String qw/utf8/; my $oshell = Win32::OLE->new('Shell.Application') or die "$@"; my $f = $oshell-

RE: Win32 API, Directories with Unicode / Wide Filenames, FindFir stFileW, FindNextFileW

2006-01-26 Thread D D Allen
Thank you for the response. I tried that but it doesn't work... because the actual filename returned by the builtin functions, using the example, is "??_HostID_2006-01-19_213218.xls". It's not just a STDOUT display issue where the leading UTF8 characters are being displayed as question

Re: Win32 API, Directories with Unicode / Wide Filenames, FindFirstFileW, FindNextFileW

2006-01-26 Thread Dewey Allen
Reini Urban wrote: The easiest fix would be to use a perl which is using the W (wide) string functions and not the A, as ActivePerl does. And then recompile libwin32. I believe that the Win32 Perl source has been "fixed" so that it only uses the ANSI versions of the Win32 API directory calls.

Re: Win32 API, Directories with Unicode / Wide Filenames, FindFirstFileW, FindNextFileW

2006-01-26 Thread D D Allen
I like your idea about packing and unpacking the data - in place of using Win32::API::Struct to create a WIN32_FIND_DATAW structure. But fiddling with this incessantly over a few days (more), it strikes me that the fundamental requirement is to get Perl to recognize the "cFileName" field retur

Re: Win32 API, Directories with Unicode / Wide Filenames, FindFirstFileW, FindNextFileW

2006-01-26 Thread Dewey Allen
Reini Urban wrote: The easiest fix would be to use a perl which is using the W (wide) string functions and not the A, as ActivePerl does. And then recompile libwin32. I believe that the Win32 Perl source has been "fixed" so that it only uses the ANSI versions of the Win32 API directory calls.

Re: Win32 API, Directories with Unicode / Wide Filenames, FindFirstFileW, FindNextFileW

2006-01-26 Thread D D Allen
I believe that the Win32 Perl source has been "fixed" so that it only uses the ANSI versions of the Win32 API directory calls. If correct, then there is no "perl" for Win32 that uses the Win32 API wide directory calls to implement Perl's builtin directory functions. See the following. http:/