From 25adc7d71f31c0c41970a920479f0c4148401a40 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Fri, 1 Aug 2008 15:12:15 +0000 Subject: [PATCH] open files in UTF-8 mode to help MARC::Batch --- dump_inverse_select_marc.pl | 6 +++++- fingerprints.pl | 6 +++++- select_marc.pl | 6 +++++- spit_csv.pl | 5 ++++- spit_tlc_marc_holdings.pl | 5 ++++- spit_unicorn_marc_holdings.pl | 5 ++++- trim_marc_based_on_tag_subfield_value.pl | 5 ++++- 7 files changed, 31 insertions(+), 7 deletions(-) diff --git a/dump_inverse_select_marc.pl b/dump_inverse_select_marc.pl index 666d567..249cad5 100755 --- a/dump_inverse_select_marc.pl +++ b/dump_inverse_select_marc.pl @@ -21,11 +21,15 @@ my $id_tag = $ARGV[2]; my $id_subfield = $ARGV[3]; binmode(STDOUT, ':utf8'); binmode(STDIN, ':utf8'); +my $M; + foreach $argnum ( 4 .. $#ARGV ) { print STDERR "Processing " . $ARGV[$argnum] . "\n"; - my $batch = MARC::Batch->new('XML',$ARGV[$argnum]); + open $M, '<:utf8', $ARGV[$argnum]; + + my $batch = MARC::Batch->new('XML',$M); $batch->strict_off(); $batch->warnings_off(); diff --git a/fingerprints.pl b/fingerprints.pl index ff2d1a9..31301e1 100755 --- a/fingerprints.pl +++ b/fingerprints.pl @@ -12,11 +12,15 @@ my $id_tag = $ARGV[1]; my $id_subfield = $ARGV[2]; binmode(STDOUT, ':utf8'); binmode(STDIN, ':utf8'); +my $M; + foreach $argnum ( 3 .. $#ARGV ) { print STDERR "Processing " . $ARGV[$argnum] . "\n"; - my $batch = MARC::Batch->new('XML',$ARGV[$argnum]); + open $M, '<:utf8', $ARGV[$argnum]; + + my $batch = MARC::Batch->new('XML',$M); $batch->strict_off(); $batch->warnings_off(); diff --git a/select_marc.pl b/select_marc.pl index 397f763..cbd7fd9 100755 --- a/select_marc.pl +++ b/select_marc.pl @@ -19,11 +19,15 @@ my $id_tag = $ARGV[1]; my $id_subfield = $ARGV[2]; binmode(STDOUT, ':utf8'); binmode(STDIN, ':utf8'); +my $M; + foreach $argnum ( 3 .. $#ARGV ) { print STDERR "Processing " . $ARGV[$argnum] . "\n"; - my $batch = MARC::Batch->new('XML',$ARGV[$argnum]); + open $M, '<:utf8', $ARGV[$argnum]; + + my $batch = MARC::Batch->new('XML',$M); $batch->strict_off(); $batch->warnings_off(); diff --git a/spit_csv.pl b/spit_csv.pl index 339ec2f..fbf29e9 100755 --- a/spit_csv.pl +++ b/spit_csv.pl @@ -20,7 +20,10 @@ foreach my $argnum ( 0 .. 0 ) { 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(); diff --git a/spit_tlc_marc_holdings.pl b/spit_tlc_marc_holdings.pl index bf783ad..c1a0559 100755 --- a/spit_tlc_marc_holdings.pl +++ b/spit_tlc_marc_holdings.pl @@ -35,7 +35,10 @@ foreach my $argnum ( 0 .. $#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(); diff --git a/spit_unicorn_marc_holdings.pl b/spit_unicorn_marc_holdings.pl index a897e63..c99d1a1 100755 --- a/spit_unicorn_marc_holdings.pl +++ b/spit_unicorn_marc_holdings.pl @@ -30,7 +30,10 @@ foreach my $argnum ( 0 .. $#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(); diff --git a/trim_marc_based_on_tag_subfield_value.pl b/trim_marc_based_on_tag_subfield_value.pl index 841676a..b7ba249 100755 --- a/trim_marc_based_on_tag_subfield_value.pl +++ b/trim_marc_based_on_tag_subfield_value.pl @@ -19,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(); -- 1.7.2.5