projects
/
kivitendo-erp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
892e4b6
)
Bearbeiten von Druckvorlagen: Perl-Encoding richtig beachten
author
Moritz Bunkus
<m.bunkus@linet-services.de>
Thu, 11 Nov 2010 10:32:40 +0000
(11:32 +0100)
committer
Moritz Bunkus
<m.bunkus@linet-services.de>
Thu, 11 Nov 2010 10:33:34 +0000
(11:33 +0100)
SL/AM.pm
patch
|
blob
|
history
diff --git
a/SL/AM.pm
b/SL/AM.pm
index
d637e2a
..
12a4ad7
100644
(file)
--- 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);