From dffb7fd7f6cb0a71c6fdd98046e783868c415c75 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 2 Oct 2009 16:56:07 +0200 Subject: [PATCH] Die verschiedenen Iconv-Handle immer anlegen, auch wenn das locale-Verzeichnis nicht existiert. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Teil eines Bugfixes für Bug 1037. --- SL/Locale.pm | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/SL/Locale.pm b/SL/Locale.pm index 0b535d740..e3ff23692 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -66,9 +66,12 @@ sub _init { my $country = shift; my $NLS_file = shift; + $self->{charset} = Common::DEFAULT_CHARSET; + $self->{countrycode} = $country; + $self->{NLS_file} = $NLS_file; + if ($country && -d "locale/$country") { local *IN; - $self->{countrycode} = $country; if (open(IN, "<", "locale/$country/$NLS_file")) { my $code = join("", ); eval($code); @@ -80,23 +83,18 @@ sub _init { close IN; chomp $self->{charset}; - - } else { - $self->{charset} = Common::DEFAULT_CHARSET; } + } - my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET; - - $self->{iconv} = Text::Iconv->new($self->{charset}, $db_charset); - $self->{iconv_reverse} = Text::Iconv->new($db_charset, $self->{charset}); - $self->{iconv_english} = Text::Iconv->new('ASCII', $db_charset); - $self->{iconv_iso8859} = Text::Iconv->new('ISO-8859-15', $db_charset); - $self->{iconv_to_iso8859} = Text::Iconv->new($db_charset, 'ISO-8859-15'); + my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET; - $self->_read_special_chars_file($country); - } + $self->{iconv} = Text::Iconv->new($self->{charset}, $db_charset); + $self->{iconv_reverse} = Text::Iconv->new($db_charset, $self->{charset}); + $self->{iconv_english} = Text::Iconv->new('ASCII', $db_charset); + $self->{iconv_iso8859} = Text::Iconv->new('ISO-8859-15', $db_charset); + $self->{iconv_to_iso8859} = Text::Iconv->new($db_charset, 'ISO-8859-15'); - $self->{NLS_file} = $NLS_file; + $self->_read_special_chars_file($country); push @{ $self->{LONG_MONTH} }, ("January", "February", "March", "April", -- 2.20.1