Lines 25-33
Link Here
|
25 |
use strict; |
25 |
use strict; |
26 |
#use warnings; FIXME - Bug 2505 |
26 |
#use warnings; FIXME - Bug 2505 |
27 |
|
27 |
|
|
|
28 |
use open OUT=>':utf8', ':std'; |
29 |
|
28 |
# standard or CPAN modules used |
30 |
# standard or CPAN modules used |
29 |
use CGI qw(:standard); |
31 |
use CGI qw(:standard); |
30 |
use DBI; |
32 |
use DBI; |
|
|
33 |
use Encode; |
31 |
|
34 |
|
32 |
# Koha modules used |
35 |
# Koha modules used |
33 |
use C4::Context; |
36 |
use C4::Context; |
Lines 75-91
my $style_doc = $parser->parse_file($xslfile);
Link Here
|
75 |
my $stylesheet = $xslt->parse_stylesheet($style_doc); |
78 |
my $stylesheet = $xslt->parse_stylesheet($style_doc); |
76 |
my $results = $stylesheet->transform($source); |
79 |
my $results = $stylesheet->transform($source); |
77 |
my $newxmlrecord = $stylesheet->output_string($results); |
80 |
my $newxmlrecord = $stylesheet->output_string($results); |
78 |
#warn $newxmlrecord; |
81 |
$newxmlrecord=Encode::decode_utf8($newxmlrecord) unless utf8::is_utf8($newxmlrecord); #decode only if not in perl internal format |
79 |
print "Content-type: text/html\n\n"; |
82 |
print $input->header(-charset => 'UTF-8'), $newxmlrecord; |
80 |
utf8::encode($newxmlrecord); |
|
|
81 |
print $newxmlrecord; |
82 |
|
83 |
|
83 |
} else { |
84 |
} else { |
84 |
|
85 |
|
85 |
$record =GetMarcBiblio($biblionumber) unless $record; |
86 |
$record =GetMarcBiblio($biblionumber) unless $record; |
86 |
|
87 |
|
87 |
my $formatted = $record->as_formatted; |
88 |
my $formatted = $record->as_formatted; |
|
|
89 |
#$formatted=Encode::decode_utf8($formatted) unless utf8::is_utf8($formatted); |
90 |
#seems not to be necessary |
88 |
$template->param( MARC_FORMATTED => $formatted ); |
91 |
$template->param( MARC_FORMATTED => $formatted ); |
89 |
|
92 |
|
90 |
output_html_with_http_headers $input, $cookie, $template->output; |
93 |
my $output= $template->output; |
|
|
94 |
$output=Encode::decode_utf8($output) unless utf8::is_utf8($output); |
95 |
output_html_with_http_headers $input, $cookie, $output; |
91 |
} |
96 |
} |
92 |
- |
|
|