Lines 131-153
But since it handles charset, and MARC::Record, it finds its way in that package
Link Here
|
131 |
=cut |
131 |
=cut |
132 |
|
132 |
|
133 |
sub SetUTF8Flag{ |
133 |
sub SetUTF8Flag{ |
134 |
my ($record, $nfd)=@_; |
134 |
my ($record, $nfd)=@_; |
135 |
return unless ($record && $record->fields()); |
135 |
return unless ($record && $record->fields()); |
136 |
foreach my $field ($record->fields()){ |
136 |
foreach my $field ($record->fields()){ |
137 |
if ($field->tag()>=10){ |
137 |
if ($field->tag()>=10){ |
138 |
my @subfields; |
138 |
my @subfields; |
139 |
foreach my $subfield ($field->subfields()){ |
139 |
foreach my $subfield ($field->subfields()){ |
140 |
push @subfields,($$subfield[0],NormalizeString($$subfield[1],$nfd)); |
140 |
push @subfields,($$subfield[0],NormalizeString($$subfield[1],$nfd)); |
141 |
} |
141 |
} |
142 |
my $newfield=MARC::Field->new( |
142 |
eval { |
143 |
$field->tag(), |
143 |
my $newfield=MARC::Field->new( |
144 |
$field->indicator(1), |
144 |
$field->tag(), |
145 |
$field->indicator(2), |
145 |
$field->indicator(1), |
146 |
@subfields |
146 |
$field->indicator(2), |
147 |
); |
147 |
@subfields |
148 |
$field->replace_with($newfield); |
148 |
); |
149 |
} |
149 |
$field->replace_with($newfield); |
150 |
} |
150 |
}; |
|
|
151 |
warn "ERROR occurred in SetUTF8Flag $@" if $@; |
152 |
} |
153 |
} |
151 |
} |
154 |
} |
152 |
|
155 |
|
153 |
=head2 NormalizeString |
156 |
=head2 NormalizeString |