Greetings Al-kun.  Since STDIN is giving u a byte string instead of a
character string u can do ur own decoding of the string.  I think the
following example will do what u want.  I'm assuming ur unicode char's are
16 bits.


$text = "asdfgh";  # $ARGV[0]
print length $text, "\n";
@asc = unpack "S*", $text;
print join "|", @asc, "\n";
$uni = pack "U*", @asc;
print length $uni;
^D
6
29537|26212|26727|
3

The S format turns ur 6 bytes into 3 integers(machine native).  U can then
feed those 3 integers to the U format to get a unicode string.  This is
merely a workaround; Perl by all rights should take unicode directly from
STDIN.  Maybe declaring a unicode pragma on STDIN might help.

matane


At 04:04 PM 12/1/2006 -0400, [EMAIL PROTECTED] wrote:
>Stumped on this, and some of the examples in the perluniintro just seem wrong.
>
>On a Japanese version of Windows when you execute a Perl to run a script,
the length() fcn returns
>the wrong number of characters for anything you pass in as @ARGV[0], and
the split() fcn seems to
>work the same way.





--
REMEMBER THE WORLD TRADE CENTER         ---=< WTC 911 >=--
"...ne cede malis"

00000100

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to