X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fadmin.pl;h=160d303660a90694fef462ac456d7bc395f2add6;hb=d3a590db90ed6dcd1092c9e1f911f504235c0fdc;hp=c22dc7616b41a40462a966fbb903a2c12c7529a1;hpb=c3ed7ef1b20adb2e86c69e159cbff9b35acf7aac;p=kivitendo-erp.git diff --git a/bin/mozilla/admin.pl b/bin/mozilla/admin.pl index c22dc7616..160d30366 100644 --- a/bin/mozilla/admin.pl +++ b/bin/mozilla/admin.pl @@ -721,7 +721,7 @@ sub dbupdate { } sub create_dataset { - $form->{dbsources} = join " ", map { "[${_}]" } sort User->dbsources(\%$form); + $form->{dbsources} = join " ", map { "[${_}]" } sort User->dbsources($form); $form->{CHARTS} = []; @@ -737,12 +737,24 @@ sub create_dataset { my $default_charset = $dbcharset; $default_charset ||= Common::DEFAULT_CHARSET; - $form->{DBENCODINGS} = []; + my $cluster_encoding = User->dbclusterencoding($form); + if ($cluster_encoding && ($cluster_encoding =~ m/^(?:UTF-?8|UNICODE)$/i)) { + if ($dbcharset !~ m/^UTF-?8$/i) { + $form->show_generic_error($locale->text('The selected PostgreSQL installation uses UTF-8 as its encoding. ' . + 'Therefore you have to configure Lx-Office to use UTF-8 as well.'), + 'back_button' => 1); + } - foreach my $encoding (@Common::db_encodings) { - push @{ $form->{DBENCODINGS} }, { "dbencoding" => $encoding->{dbencoding}, - "label" => $encoding->{label}, - "selected" => $encoding->{charset} eq $default_charset }; + $form->{FORCE_DBENCODING} = 'UNICODE'; + + } else { + $form->{DBENCODINGS} = []; + + foreach my $encoding (@Common::db_encodings) { + push @{ $form->{DBENCODINGS} }, { "dbencoding" => $encoding->{dbencoding}, + "label" => $encoding->{label}, + "selected" => $encoding->{charset} eq $default_charset }; + } } $form->{title} =