No idea what happened to my brain here.  This was supposed to be a
response to the File Upload thread.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Webb, Andy
Sent: Sunday, December 03, 2006 7:20 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: RE: Japanese chars and ARGV

Doesn't look like you set a file name or a MIME type in the result that
would cause it to be interpreted as a document.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Chris Wagner
Sent: Friday, December 01, 2006 6:58 PM
To: perl-win32-users@listserv.ActiveState.com
Subject: Re: Japanese chars and ARGV

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
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to