fixes a bug where if the record contained wide chars already it would

throw a 500 error.
This commit is contained in:
kados 2006-03-21 14:47:12 +00:00
parent 3ab1a4aa77
commit ffa0c3a7c2
1 changed files with 6 additions and 2 deletions

View File

@ -538,8 +538,12 @@ if ($op eq "addbiblio") {
}
unless ($record == -1) {
#FIXME: it's kind of silly to go from MARC::Record to MARC::File::XML and then back again just to fix the encoding
my $uxml = $record->as_xml;
$record = MARC::Record::new_from_xml($uxml, 'UTF-8');
eval {
my $uxml = $record->as_xml;
my $newrecord = MARC::Record::new_from_xml($uxml, 'UTF-8');
$record = $newrecord;
};
}
build_tabs ($template, $record, $dbh,$encoding);
build_hidden_data;