From 686fdae32c2377b8748f71c534b5f32a2a83e850 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 27 Mar 2013 13:30:16 +0100 Subject: [PATCH] Bug 6554 QA Followup Removing binmode, now encoding data in output_with_http_headers. Replaced output_string by output_as_chars in XSLTParse4Display. Signed-off-by: Marcel de Rooy Signed-off-by: Bernardo Gonzalez Kriegel No errors. Signed-off-by: Jared Camins-Esakov --- C4/Output.pm | 7 +------ C4/XSLT.pm | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index 458b92f040..63acf1453e 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -298,17 +298,12 @@ sub output_with_http_headers { $options->{'Content-Script-Type'} = 'text/javascript'; } -# We can't encode here, that will double encode our templates, and xslt -# We need to fix the encoding as it comes out of the database, or when we pass the variables to templates - -# utf8::encode($data) if utf8::is_utf8($data); - $data =~ s/\&\;amp\; /\&\; /g; + utf8::encode($data); print $query->header($options), $data; } sub output_html_with_http_headers { - binmode( STDOUT, ":encoding(utf8)" ); my ( $query, $cookie, $data, $status ) = @_; output_with_http_headers( $query, $cookie, $data, 'html', $status ); } diff --git a/C4/XSLT.pm b/C4/XSLT.pm index bab03bc57e..dd1967acf6 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -221,7 +221,8 @@ sub XSLTParse4Display { $stylesheet->{$xslfilename} = $xslt->parse_stylesheet($style_doc); } my $results = $stylesheet->{$xslfilename}->transform($source); - my $newxmlrecord = $stylesheet->{$xslfilename}->output_string($results); + my $newxmlrecord = $stylesheet->{$xslfilename}->output_as_chars($results); + #no need to decode with UTF-8 in header of XSLT templates: BZ 6554 return $newxmlrecord; } -- 2.39.5