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