Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] unicode and Perl- how to pass command line unicodearguments



David E replied to David Riggs:

On Date: Sun, 12 Feb 2006 17:30:00 +0900, David Riggs 
<dariggs@example.com> wrote:
 > Does anyone know how to pass real unicode kanji to perl on the command
 > line? (Not just bytes that appear as kanji but are passed on as 
bytes.)---

--Reply:
---You might need to do
---  utf8::decode($whatever)
---on the args you read in.

--More info here:
---http://search.cpan.org/~jhi/perl-5.8.0/pod/perluniintro.pod

Dave
-----------

Thanks David. I got something similar to work (follow your link):

  use Encode 'decode_utf8';
     $Unicode = decode_utf8($bytes);

Somehow your suggested utf8::decode($x) only returns a "1", presumably 
for success, and I do not see how to get it to return the value.

By the way, I find that perl m/// and s/// just do not work on kanji 
unicode typed directly into the expression. But if you set the kanji 
into a variable, and then immediately use it one of those operators, its 
fine.

Very mystifying.

Thanks for the help, now that I realize these two additional things I 
have perl unicoding away.

And I thought perl was supposed to just work with unicode!


David Riggs


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links