Bug 6996: Encoding problem in opac-showmarc

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
No more encoding problems spotted.

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Marcel de Rooy 2011-10-12 14:43:53 +02:00 committed by Chris Cormack
parent aca414977a
commit a7d0255f19

View file

@ -27,8 +27,11 @@
use strict; use strict;
use warnings; use warnings;
use open OUT=>':utf8', ':std';
# standard or CPAN modules used # standard or CPAN modules used
use CGI; use CGI;
use Encode;
# Koha modules used # Koha modules used
use C4::Context; use C4::Context;
@ -79,8 +82,8 @@ if ($view eq 'card' || $view eq 'html') {
my $stylesheet = $xslt->parse_stylesheet($style_doc); my $stylesheet = $xslt->parse_stylesheet($style_doc);
my $results = $stylesheet->transform($source); my $results = $stylesheet->transform($source);
my $newxmlrecord = $stylesheet->output_string($results); my $newxmlrecord = $stylesheet->output_string($results);
print $input->header(), $newxmlrecord; $newxmlrecord = Encode::decode_utf8($newxmlrecord) unless utf8::is_utf8($newxmlrecord);
exit; print $input->header(-charset => 'UTF-8'), $newxmlrecord;
} else { } else {
$record =GetMarcBiblio($biblionumber) unless $record; $record =GetMarcBiblio($biblionumber) unless $record;
$template->param( MARC_FORMATTED => $record->as_formatted ); $template->param( MARC_FORMATTED => $record->as_formatted );