From: Moritz Bunkus Date: Wed, 8 Sep 2010 10:09:35 +0000 (+0200) Subject: ZIP-Inhalt von und nach internes Encoding wandeln X-Git-Tag: release-2.6.2beta1~154^2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4c19594dc3035082cf79a81b285000f419429624;p=kivitendo-erp.git ZIP-Inhalt von und nach internes Encoding wandeln --- 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) {