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



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.)
> 
> I finally magaged to get perl to do unicode work by saying 1. use utf8; 
> (to have unicode in the script), and 2. invoding with -CSio switch (to 
> do I/O in unicode). With these I can finally manipulate kanji (i.e. use 
> tr/// to tranlate from one to another kanji and s/// to do real 
> character classes and such).
> 
> But perl still reads the command line arguments as bytes, and they get 
> mangled in the script. I just want to pass it a kanji string. I am 
> limping along by reading from <STDIN>, but that messes up my abiility to 
> make a pipeline of perl scripts.

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 for any help,
> 
> David Riggs, Kyoto
> 
> -- 
> The TLUG server is hosted by Open Source Development Lab Japan.
> http://www.osdl.jp/
> 
> To unsubscribe from this mailing list, 
> please see the instructions at http://www.tlug.jp/list.html


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links