From: Galen Charlton Date: Thu, 31 Jan 2008 19:43:17 +0000 (-0600) Subject: staged MARC import: handle non-ASCII characters in items X-Git-Tag: v3.00.00-beta~495 X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=commitdiff_plain;h=718ff8b3397c3b63309beec15f369932a1662b80;p=koha_fer staged MARC import: handle non-ASCII characters in items The problem occured during the population of import_items.marcxml -- the MARC::Record object created to store the item did not have the Leader/09 set to 'a', which means that MARC::File::XML tried to transcode code the item from MARC-8 to UTF-8, which breaks since the MARC data is already in UTF-8 at that point. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 028f87fb20..daa38a8548 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -269,7 +269,7 @@ sub BatchStageMarcRecords { if ($progress_interval and (0 == ($rec_num % $progress_interval))) { &$progress_callback($rec_num); } - my $marc_record = FixEncoding($marc_blob, "\x1D"); + my $marc_record = FixEncoding($marc_blob); my $import_record_id; if (scalar($marc_record->fields()) == 0) { push @invalid_records, $marc_blob; @@ -312,6 +312,7 @@ sub AddItemsToImportBiblio { my ($item_tag,$item_subfield) = &GetMarcFromKohaField("items.itemnumber",''); foreach my $item_field ($marc_record->field($item_tag)) { my $item_marc = MARC::Record->new(); + $item_marc->leader("00000 a "); # must set Leader/09 to 'a' $item_marc->append_fields($item_field); $marc_record->delete_field($item_field); my $sth = $dbh->prepare_cached("INSERT INTO import_items (import_record_id, status, marcxml)