From 4c19594dc3035082cf79a81b285000f419429624 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 8 Sep 2010 12:09:35 +0200 Subject: [PATCH] ZIP-Inhalt von und nach internes Encoding wandeln --- SL/Template/OpenDocument.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/SL/Template/OpenDocument.pm b/SL/Template/OpenDocument.pm index 98fba0592..2ed3c60fa 100644 --- a/SL/Template/OpenDocument.pm +++ b/SL/Template/OpenDocument.pm @@ -3,6 +3,7 @@ package SL::Template::OpenDocument; use parent qw(SL::Template::Simple); use Archive::Zip; +use Encode; use POSIX 'setsid'; use SL::Iconv; @@ -228,7 +229,7 @@ sub parse { return 0; } - my $contents = $zip->contents("content.xml"); + my $contents = Encode::decode('utf-8-strict', $zip->contents("content.xml")); if (!$contents) { $self->{"error"} = "File is not a OpenDocument file."; $main::lxdebug->leave_sub(); @@ -267,7 +268,7 @@ sub parse { # $new_contents =~ s|>|>\n|g; - $zip->contents("content.xml", $new_contents); + $zip->contents("content.xml", Encode::encode('utf-8-strict', $new_contents)); my $styles = $zip->contents("styles.xml"); if ($contents) { -- 2.20.1