in reply to Re: Win32::API and CreateProcessWithLogonW
in thread Win32::API and CreateProcessWithLogonW
I convert between UTF-16LE (not "UTF8LE" as you wrote) and ASCII or UTF-8 using pack rather simply:
$utf16= pack "S*", unpack( "C*", $ascii ), 0; $utf16= pack "S*", unpack( "U*", $utf8 ), 0; $ascii= pack "C*", unpack( "S*", $utf16 ); $ascii =~ s/\0$//; $utf8 = pack "U*", unpack( "S*", $utf16 ); $utf8 =~ s/\0$//;
but note that this doesn't handle extra large Unicode code points (which Windows doesn't handle by default either but can be configured to support at least partially).
To feel less hackish, one would likely use the Encode module, which can probably also handle the characters in the Windows-1252 extensions to Latin-1.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Win32::API and CreateProcessWithLogonW
by BrowserUk (Patriarch) on Jan 30, 2007 at 07:15 UTC | |
by tye (Sage) on Jan 30, 2007 at 07:21 UTC |