Working around a UTF8/Unicode encoding problem

[email protected] (William Denton)
Newsgroups perl.perl4lib
Message-ID <[email protected]>
I have a MARC file [1] that contains a record (ID number 4240822) with a 
problem.  I whipped up this script to have a look at things:

   #!/usr/local/bin/perl -w

   my $oldmarc  = shift;
   die "Usage: $0 old.marc" unless defined $oldmarc;

   use MARC::Batch;
   my $batch = MARC::Batch->new('USMARC', $oldmarc);
   $batch->strict_off();

   while (my $record = $batch -> next()) {
       print $record->title(), "\n";
   }

I set strict_off so it will "continue after it has encountered what it 
believes to be bad MARC data," which is handy, but its fails on an error 
outside that, from the Encode module:

$ ./test.pl pride-and-prejudice.marc
Complete novels of Jane Austen
utf8 "\xB9" does not map to Unicode at /usr/local/lib/perl5/5.8.8/mach/Encode.pm line 166.

Is there any easy way around this that would let me still use MARC::Batch? 
I'm not sure how I might trap errors with eval here.  I can step through 
the records directly, but the Batch thing is pretty handy.

Thanks,

Bill

[1] http://www.frbr.org/files/pride-and-prejudice.marc
-- 
William Denton, Toronto : www.miskatonic.org www.frbr.org www.openfrbr.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.