From 94508a5c3d712f03d25ef63c40830b0c147140c5 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 29 Apr 2013 15:17:06 -0700 Subject: [PATCH] Revert "Bug 6554 QA Followup" This reverts commit 686fdae32c2377b8748f71c534b5f32a2a83e850. Rolling back bug 6554 work until we have more comprehensive tests. --- C4/Output.pm | 7 ++++++- C4/XSLT.pm | 3 +-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/C4/Output.pm b/C4/Output.pm index 63acf1453e..458b92f040 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -298,12 +298,17 @@ 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 8f24df9e74..69516742cd 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -221,8 +221,7 @@ sub XSLTParse4Display { $stylesheet->{$xslfilename} = $xslt->parse_stylesheet($style_doc); } my $results = $stylesheet->{$xslfilename}->transform($source); - my $newxmlrecord = $stylesheet->{$xslfilename}->output_as_chars($results); - #no need to decode with UTF-8 in header of XSLT templates: BZ 6554 + my $newxmlrecord = $stylesheet->{$xslfilename}->output_string($results); return $newxmlrecord; } -- 2.11.0