perldoc unreadable char w/ stock LANG settings

Harry Putnam reader at newsguy.com
Tue Apr 20 02:15:16 UTC 2004


I've noticed this a few times now.  Using vim to write scripts and
using code copied from perldoc display of some module.

Somehow some unprintable chars end up in my cut and paste.  Perl
notices `\xE2' Unrecognized character \xE2 at ./tar.pl line 9

It seems to be where there would normally be single or double quotes.
Some how the new LANG stuff drops them on perldoc printouts and
inserts something else (that is invisible) an \xE2.

Something to do with UTF-8 I think

Here is an example cut from perldoc Archive::Tar
(Only edited by commenting a few lines I didn't need).

cat new.pl
#!/usr/local/bin/perl -w

           use Archive::Tar;
           my $tar = Archive::Tar->new;

#           $tar->read(’origin.tgz’,1);
#           $tar->extract();

           $tar->add_files(’mns.pl’, ’mns2.pl’);
           $tar->add_data(’baz.txt’, ’This is the contents now’);

#           $tar->rename(’oldname’, ’new/file/name’);

           $tar->write(’files.tar’);

Running it gives the error:
 $ ./new.pl 
Unrecognized character \xE2 at ./new.pl line 9.

If I rewrite the lines and add quotes and remove the spaces in original
it works then.





More information about the fedora-test-list mailing list