From: Moritz Bunkus Date: Thu, 11 Nov 2010 10:32:40 +0000 (+0100) Subject: Bearbeiten von Druckvorlagen: Perl-Encoding richtig beachten X-Git-Tag: release-2.6.2beta1~89^2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8c051f471ca8bbfb9582c60e26689efcd47cd96c;p=kivitendo-erp.git Bearbeiten von Druckvorlagen: Perl-Encoding richtig beachten --- diff --git a/SL/AM.pm b/SL/AM.pm index d637e2a59..12a4ad7d3 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -39,6 +39,7 @@ package AM; use Carp; use Data::Dumper; +use Encode; use SL::DBUtils; use strict; @@ -1315,6 +1316,8 @@ sub load_template { close(TEMPLATE); } + $content = Encode::decode('utf-8-strict', $content) if $::locale->is_utf8; + $main::lxdebug->leave_sub(); return ($content, $lines); @@ -1330,6 +1333,7 @@ sub save_template { my $error = ""; if (open(TEMPLATE, ">$filename")) { + $content = Encode::encode('utf-8-strict', $content) if $::locale->is_utf8; $content =~ s/\r\n/\n/g; print(TEMPLATE $content); close(TEMPLATE);