[wplug] perl system function not displaying unicode text.
Matthew T. Engel
mengel at allegheny.edu
Tue Sep 4 14:05:32 EDT 2007
I think the problem is that I am trying to use the system function to echo
text to the terminal. Something like:
#!/usr/bin/perl
while(<>)
{
chomp;
system("echo $_");
}
If I run the script via
$ cat ascii_text_file | ./above_script.pl Everything works fine where it
essentially cats the input file. However, if I do a $ cat unicode_text_file
| ./above_script.pl. I get blank lines where the echo'd data should be.
I think the second file is Unicode because doing a $od -c Unicode_text file,
shows /0 in front of all the characters, and if I vi the same file it shows
^@ before every character.
I would like to be able to use Unicode and ascii text files
interchangeabley. please advice. Thank you very much in advance.
Matt
Matthew T. Engel
Systems Administrator
Allegheny College, Department of Computer Science
Meadville, PA 16335
mengel at allegheny.edu
mtengel at andrew.cmu.edu
(814) 332-2906
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.wplug.org/pipermail/wplug/attachments/20070904/46fe85a0/attachment.html
More information about the wplug
mailing list