more better error reporting
[migration-tools.git] / trim_marc_based_on_tag_subfield_value.pl
index c8f1925..b7ba249 100755 (executable)
@@ -1,4 +1,5 @@
 #!/usr/bin/perl
+use open ':utf8';
 use MARC::Batch;
 use MARC::File::XML ( BinaryEncoding => 'utf-8' );
 use MARC::Field;
@@ -18,7 +19,10 @@ foreach $argnum ( 3 .. $#ARGV ) {
 
        print STDERR "Processing " . $ARGV[$argnum] . "\n";
 
-       my $batch = MARC::Batch->new('XML',$ARGV[$argnum]);
+    my $M;
+    open $M, '<:utf8', $ARGV[$argnum];
+    my $batch = MARC::Batch->new('XML',$M);
+
        $batch->strict_off();
        $batch->warnings_off();