From a7d0255f19bf2de5a9bfc50eb76e108ed32e85c0 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 12 Oct 2011 14:43:53 +0200 Subject: [PATCH] Bug 6996: Encoding problem in opac-showmarc Signed-off-by: Katrin Fischer No more encoding problems spotted. Signed-off-by: Paul Poulain Signed-off-by: Chris Cormack --- opac/opac-showmarc.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index 447551289e..673069eec4 100755 --- a/opac/opac-showmarc.pl +++ b/opac/opac-showmarc.pl @@ -27,8 +27,11 @@ use strict; use warnings; +use open OUT=>':utf8', ':std'; + # standard or CPAN modules used use CGI; +use Encode; # Koha modules used use C4::Context; @@ -79,8 +82,8 @@ if ($view eq 'card' || $view eq 'html') { my $stylesheet = $xslt->parse_stylesheet($style_doc); my $results = $stylesheet->transform($source); my $newxmlrecord = $stylesheet->output_string($results); - print $input->header(), $newxmlrecord; - exit; + $newxmlrecord = Encode::decode_utf8($newxmlrecord) unless utf8::is_utf8($newxmlrecord); + print $input->header(-charset => 'UTF-8'), $newxmlrecord; } else { $record =GetMarcBiblio($biblionumber) unless $record; $template->param( MARC_FORMATTED => $record->as_formatted );