From 60f436ef926daec0db0b0a554f5b44e06cafc4b6 Mon Sep 17 00:00:00 2001 From: Alexandre Noel Date: Fri, 28 Jun 2024 08:38:54 -0400 Subject: [PATCH] Bug 37184 - Special character encoding problem when importing MARC file from the Acquisitions module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Go to Cataloging > "Stage records for import". 2. Upload the file "ExportMemento2024061010532869Marc8.mrc" or a MARC8 encoded file. 3. In the form, select the options : - Record type: Bibliographic - Character encoding: MARC8 - Format: MARC 4. Click "Stage for import". 5. Find or create an open basket in the Acquisitions module. 6. Click "add to basket". 7. Select "From a staged file" and select the previous staged file. 9. Click "Select all" to check all records. 10. In the item information tab, choose the Document type. 11. Verify the titles of the records in the basket: --> Koha replaces accents with symbols � 12. Apply the patch. 13. Do the same from step 1 and notice there is no more encoding issues. --- Koha/Import/Record.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Koha/Import/Record.pm b/Koha/Import/Record.pm index ea238e6254..a68f4b9c49 100644 --- a/Koha/Import/Record.pm +++ b/Koha/Import/Record.pm @@ -56,7 +56,8 @@ sub get_marc_record { $format = 'UNIMARCAUTH'; } - my $record = MARC::Record->new_from_xml($self->marcxml, $self->encoding, $format); + my $encoding = $self->encoding eq 'MARC-8' ? 'UTF-8' : $self->encoding; # MARC-8 is not a valid encoding in Koha + my $record = MARC::Record->new_from_xml($self->marcxml, $encoding, $format); return $record; } -- 2.34.1