From 945793f0b279b59e89523634dd998cc17766f31f Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 19 Feb 2015 11:55:33 +0100 Subject: [PATCH] =?utf8?q?SL::DBUpgrade2:=20Dateien=20direkt=20als=20UTF-8?= =?utf8?q?=20=C3=B6ffnen=20und=20SL::IConv=20nicht=20nutzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DBUpgrade2.pm | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/SL/DBUpgrade2.pm b/SL/DBUpgrade2.pm index 65944f213..6d0b207a7 100644 --- a/SL/DBUpgrade2.pm +++ b/SL/DBUpgrade2.pm @@ -7,7 +7,6 @@ use List::MoreUtils qw(any); use SL::Common; use SL::DBUpgrade2::Base; use SL::DBUtils; -use SL::Iconv; use strict; @@ -52,7 +51,7 @@ sub parse_dbupdate_controls { my $path = $self->path; foreach my $file_name (<$path/*.sql>, <$path/*.pl>) { - next unless (open(IN, $file_name)); + next unless (open(IN, "<:encoding(UTF-8)", $file_name)); my $file = $file_name; $file =~ s|.*/||; @@ -133,7 +132,7 @@ sub process_query { my ($self, $dbh, $filename, $version_or_control) = @_; my $form = $self->{form}; - my $fh = IO::File->new($filename, "r"); + my $fh = IO::File->new($filename, "<:encoding(UTF-8)"); my $query = ""; my $sth; my @quote_chars; @@ -146,8 +145,6 @@ sub process_query { $dbh->begin_work(); while (<$fh>) { - $_ = SL::Iconv::convert('UTF-8', 'UTF-8', $_); - # Remove DOS and Unix style line endings. chomp; @@ -333,8 +330,6 @@ sub apply_admin_dbupgrade_scripts { $self->{form}->{login} ||= 'admin'; - map { $_->{description} = SL::Iconv::convert('UTF-8', 'UTF-8', $_->{description}) } values %{ $self->{all_controls} }; - if ($called_from_admin) { $self->{form}->{title} = $::locale->text('Dataset upgrade'); $self->{form}->header; -- 2.20.1