Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Unicode in filenames (part 2)

by Thelonius (Priest)
on Mar 21, 2006 at 01:39 UTC ( [id://538097]=note: print w/replies, xml ) Need Help??


in reply to Unicode in filenames (part 2)

my $filename = "\x{4e2d}\x{63f7}"; # or any other way of creating utf8 string my $ret = CreateFileW(encode("utf16le", $filename . "\0"), GENERIC_WRITE, FILE_SHARE_READ, [], CREATE_ALWAYS, FILE_ATTRIBUTE_NO +RMAL, 0);

Replies are listed 'Best First'.
Re^2: Unicode in filenames (part 2)
by Anonymous Monk on Mar 21, 2006 at 08:41 UTC

    Thank you, Thelonius! That works great.

    Obviously, the module documentation needs fixing. How do I go about that?

    Any idea why the three createFile calls are failing?

      I would send any change requests to the module author, tyemq@cpan.org and the libwin32 maintainer, jand@activestate.com.

      Change requests are more likely to be made expeditiously if you submit them as patches (another Larry Wall claim to fame).

      Calling createFile with just the file name defaults to "r ke" access, i.e. GENERIC_READ, OPEN_EXISTING.

      Did the files exist?

      createFile() probably wraps CreateFileA() which is the single byte version.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://538097]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (3)
As of 2024-06-22 02:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.