epic-ts
[kivitendo-erp.git] / SL / FCGIFixes.pm
index 6327ffc..62f4a93 100644 (file)
@@ -10,7 +10,7 @@ use version;
 # setting STDOUT to ":utf8" with "binmode".  Also FCGI starting with
 # 0.69 implements proper handling for UTF-8 flagged strings -- namely
 # by downgrading them into bytes. The combination of the two causes
-# Lx-Office's way of handling strings to go belly up (storing
+# kivitendo's way of handling strings to go belly up (storing
 # everything in Perl's internal encoding and using Perl's I/O layer
 # for automatic conversion on output).
 #
@@ -25,7 +25,6 @@ use version;
 
 sub fix_print_and_internal_encoding_after_0_68 {
   return if version->new("$FCGI::VERSION")->numify <= version->new("0.68")->numify;
-  return if lc($::lx_office_conf{system}->{dbcharset}) !~ m/^(?:utf-?8|unicode)$/;
 
   my $encoder             = Encode::find_encoding('UTF-8');
   my $original_fcgi_print = \&FCGI::Stream::PRINT;
@@ -35,7 +34,7 @@ sub fix_print_and_internal_encoding_after_0_68 {
   *FCGI::Stream::PRINT = sub {
     if (!$::locale || !$::locale->raw_io_active) {
       my $self = shift;
-      my @vals = map { $encoder->encode($_, Encode::FB_CROAK|Encode::LEAVE_SRC) } @_;
+      my @vals = map { $encoder->encode("$_", Encode::FB_CROAK|Encode::LEAVE_SRC) } @_;
       @_ = ($self, @vals);
     }