From f66fffe454e78a2c2910bea382c15fe7df8ff01a Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Thu, 10 Aug 2023 08:50:44 -1000 Subject: [PATCH] Bug 34514: opac-showmarc.pl use marc flavour MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit opac-showmarc.pl calls $record->as_xml. We see in other places using XSL transformation that MARC flavor should be sent. Looks like encoding fails when a "real" UTF-8 character is used. For example uppercase é Bug 29333 fixed catalogue/showmarc.pl. Test plan : 1) Use UNIMARC database 2) Edit a biblio record to add uppercase é in title 200$a 3) Go to OPAC MARC vue of this record 4) Download record as MARCXML => Check encoding of title is OK 5) Click on 'view plain' => Check encoding of title is OK --- opac/opac-showmarc.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index 57c63fede1..b19f861824 100755 --- a/opac/opac-showmarc.pl +++ b/opac/opac-showmarc.pl @@ -56,6 +56,8 @@ unless ( $biblio ) { } my $view= $input->param('viewas') || 'marc'; +my $marcflavour = C4::Context->preference('marcflavour'); +my $format = $marcflavour eq 'UNIMARC' ? 'UNIMARC' : 'USMARC'; my $record_processor = Koha::RecordProcessor->new( { @@ -77,7 +79,7 @@ if(!ref $record) { $record_processor->process($record); if ($view eq 'card' || $view eq 'html') { - my $xml = $record->as_xml; + my $xml = $record->as_xml($format); my $xsl = $view eq 'card' ? 'compact.xsl' : 'plainMARC.xsl'; my $htdocs = C4::Context->config('opachtdocs'); my ($theme, $lang) = C4::Templates::themelanguage($htdocs, $xsl, 'opac', $input); -- 2.41.0