Revert "Bug 6554 QA Followup"
authorGalen Charlton <gmc@esilibrary.com>
Mon, 29 Apr 2013 22:17:06 +0000 (15:17 -0700)
committerGalen Charlton <gmc@esilibrary.com>
Mon, 29 Apr 2013 22:17:06 +0000 (15:17 -0700)
This reverts commit 686fdae32c2377b8748f71c534b5f32a2a83e850.

Rolling back bug 6554 work until we have more comprehensive tests.

C4/Output.pm
C4/XSLT.pm

index 63acf14..458b92f 100644 (file)
@@ -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\;amp\; /\&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 );
 }
index 8f24df9..6951674 100644 (file)
@@ -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;
 }