in reply to Extra spaces in COM strings to stdout?
You should look at "Encode" man page (and probably "perlunicode" and even "perluniintro", for a well-rounded education). The thing you need to do is "decode" that text string from UTF-16LE into perl's native utf8. Assuming the string really is just ASCII characters, nothing else should be necessary -- it so happens that ASCII is now a proper subset (a very small subset) of utf8. Supposing you assign the string in question to a scalar, say $comstring, you could convert it for proper display with something like this:
use Encode; ... my $displayable = decode( 'UTF-16LE', $comstring ); print $displayable; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Extra spaces in COM strings to stdout?
by kal (Hermit) on Mar 20, 2004 at 15:39 UTC | |
by graff (Chancellor) on Mar 20, 2004 at 15:58 UTC |