X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/463ea8525a073beedbd4a25712b2cb4654734054..f04a7950a3040894b77e09289a71d3931ce898d0:/SL/Dispatcher.pm diff --git a/SL/Dispatcher.pm b/SL/Dispatcher.pm index 3a1e8d84a..687c37306 100644 --- a/SL/Dispatcher.pm +++ b/SL/Dispatcher.pm @@ -9,7 +9,9 @@ BEGIN { } use CGI qw( -no_xhtml); +use Config::Std; use DateTime; +use Encode; use English qw(-no_match_vars); use SL::Auth; use SL::LXDebug; @@ -92,6 +94,9 @@ sub pre_startup_setup { $::form = undef; %::myconfig = (); %::called_subs = (); # currently used for recursion detection + + read_config 'config/lx_office.conf' => %::lx_office_conf if -f "config/lx_office.conf"; + _decode_recursively(\%::lx_office_conf); } $SIG{__WARN__} = sub { @@ -320,6 +325,18 @@ sub get_standard_filehandles { return $self->{interface} =~ m/f(?:ast)cgi/i ? $self->{request}->GetHandles() : (\*STDIN, \*STDOUT, \*STDERR); } +sub _decode_recursively { + my ($obj) = @_; + + while (my ($key, $value) = each %{ $obj }) { + if (ref($value) eq 'HASH') { + _decode_recursively($value); + } else { + $obj->{$key} = decode('UTF-8', $value); + } + } +} + package main; use strict;