From 12f0f05d95dc8a9cb05b19b6d8af329fdc72d1bc Mon Sep 17 00:00:00 2001 From: josch Date: Mon, 17 Dec 2007 22:52:36 +0000 Subject: [PATCH] fixed libxslt utf8 bug git-svn-id: http://yolanda.mister-muffin.de/svn@205 7eef14d0-6ed0-489d-bf55-20463b2d70db --- trunk/functions.pl | 19 +++++++++++-------- trunk/upload.pl | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/trunk/functions.pl b/trunk/functions.pl index bae30ae..7f09a72 100644 --- a/trunk/functions.pl +++ b/trunk/functions.pl @@ -143,12 +143,10 @@ sub output_page my $stylesheet = $xslt->parse_stylesheet($parser->parse_file("$root/xsl/xhtml.xsl")); - return $session->header( - -type=>'text/xml', - -charset=>'UTF-8' - ), - $stylesheet->output_string( - $stylesheet->transform( + #TODO: this usage of libxsl omits the xsl:output definition (no ident of html) but outputs in UTF8 + #TODO: later versions of XML::LibXSLT (>= 1.62) define output_as_bytes - this is what we want to use + #TODO: wait for debian packagers to update to 1.62 or later + $foo = $stylesheet->transform( $parser->parse_string( XMLout( $page, @@ -158,6 +156,11 @@ sub output_page AttrIndent => '1' ) ) - ) - ); + ); + + return $session->header( + -type=>'text/xml', + -charset=>'UTF-8' + ), + $foo->toString; } diff --git a/trunk/upload.pl b/trunk/upload.pl index a636ab6..74d1f00 100644 --- a/trunk/upload.pl +++ b/trunk/upload.pl @@ -3,7 +3,7 @@ require "functions.pl"; #create or resume session CGI::Session->name($session_name); $query = new CGI; -my $session = new CGI::Session; +$session = new CGI::Session; @userinfo = get_userinfo_from_sid($session->id);