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
Um, actually, Win32API::File does have CreateFileW(), just not mentioned in the documentation.
my $wPath= pack "S*", unpack( "C*", "C:/server/htdocs/DEVELOPMENT/testing/" ), 19968, 26869, 39640, 26641, unpack( "C*", "/test/test.ssi" ), 0; my $hFile= CreateFileW( $wPath, GENERIC_READ()|GENERIC_WRITE(), FILE_SHARE_READ()|FILE_SHARE_WRITE(), [], OPEN_EXISTING(), 0, [] ) or die "Can't open: $^E\n"; OsFHandleOpen( *DATFILE, $hFile, "rw" ) or die "Can't create Perl handle: $!\n"; my $strHeaderLine = <DATFILE>; print $strHeaderLine; close DATFILE;
Note, this code is untested because I composed it under Linux.
Update: I need to update createFile() to detect UTF-8 path names and do all this for you...
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Problems Opening file with Perl where path has UTF8 (d'oh!)
by ikegami (Patriarch) on Nov 23, 2006 at 19:45 UTC | |
by tye (Sage) on Nov 25, 2006 at 08:18 UTC | |
by ikegami (Patriarch) on Nov 25, 2006 at 16:20 UTC |