From 8c051f471ca8bbfb9582c60e26689efcd47cd96c Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 11 Nov 2010 11:32:40 +0100 Subject: [PATCH] Bearbeiten von Druckvorlagen: Perl-Encoding richtig beachten --- SL/AM.pm | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 2.20.1