From: Moritz Bunkus Date: Wed, 10 Feb 2010 11:07:39 +0000 (+0100) Subject: Bei Datenbankverbindungen Option pg_enable_utf8 setzen X-Git-Tag: release-2.6.2beta1~201 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7535161df28588d394a01640d898ff12630611a0;p=kivitendo-erp.git Bei Datenbankverbindungen Option pg_enable_utf8 setzen Natürlich abhängig von $::dbcharset --- diff --git a/SL/Form.pm b/SL/Form.pm index 6ad6a9208..cab29d426 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1547,15 +1547,21 @@ sub datetonum { # Database routines used throughout +sub _dbconnect_options { + my $self = shift; + my $options = { pg_enable_utf8 => $::locale->is_utf8, + @_ }; + + return $options; +} + sub dbconnect { $main::lxdebug->enter_sub(2); my ($self, $myconfig) = @_; # connect to database - my $dbh = - DBI->connect($myconfig->{dbconnect}, - $myconfig->{dbuser}, $myconfig->{dbpasswd}) + my $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options) or $self->dberror; # set db options @@ -1574,9 +1580,7 @@ sub dbconnect_noauto { my ($self, $myconfig) = @_; # connect to database - my $dbh = - DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, - $myconfig->{dbpasswd}, { AutoCommit => 0 }) + my $dbh = DBI->connect($myconfig->{dbconnect}, $myconfig->{dbuser}, $myconfig->{dbpasswd}, $self->_dbconnect_options(AutoCommit => 0)) or $self->dberror; # set db options