Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: En/Decode a unicode path

by ikegami (Patriarch)
on Jan 23, 2023 at 22:24 UTC ( [id://11149796]=note: print w/replies, xml ) Need Help??


in reply to Re: En/Decode a unicode path
in thread En/Decode a unicode path

For every Windows API function that deals with a string, there's an (A)NSI and a (W)ide version of it.

The ANSI version uses the ANSI/Active Code Page as the encoding, while the wide version uses UTF-16le.

Perl builtins use the (A)NSI version of API functions, so interactions with the system via Perl builtins are limited to the character set of the ACP.

For Windows for the American market, the system's ACP is 1252.

Replies are listed 'Best First'.
Re^3: En/Decode a unicode path
by exilepanda (Friar) on Jan 24, 2023 at 05:21 UTC
    Perl builtins use the (A)NSI version of API functions
    Thank you! This is some how inspiring. Now I can do this :
    use Win32; use Storable; my $file = Win32::GetShortPathName('X:\Some\Unicode\Path\\'); # it giv +es me a 8.3 path print -e $file; # Got it! store {}, "$file/Storable.sto"; # Done!
    The only draw back for now is the path/file must existing, so that the FS can "assign" the 8.3 location.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-03-29 07:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found