X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/694ced449e7ba97d19119d6a03080f8c5d0f3e04..c9902d7658d0cacdf665971b32de0e054637efd0:/SL/Locale.pm diff --git a/SL/Locale.pm b/SL/Locale.pm index b1c8205e8..e9967396c 100644 --- a/SL/Locale.pm +++ b/SL/Locale.pm @@ -109,6 +109,7 @@ sub _init { $self->{iconv_english} = SL::Iconv->new('ASCII', $db_charset); $self->{iconv_iso8859} = SL::Iconv->new('ISO-8859-15', $db_charset); $self->{iconv_to_iso8859} = SL::Iconv->new($db_charset, 'ISO-8859-15'); + $self->{iconv_utf8} = SL::Iconv->new('UTF-8', $db_charset); $self->_read_special_chars_file($country); @@ -231,6 +232,7 @@ sub findsub { my ($self, $text) = @_; my $text_rev = lc $self->{iconv_reverse}->convert($text); + $text_rev =~ s/[\s\-]+/_/g; if (!$self->{texts_reverse}) { $self->{texts_reverse} = { }; @@ -240,7 +242,7 @@ sub findsub { $original =~ s/_+/_/g; $translation = lc $translation; - $translation =~ s/\s+/_/g; + $translation =~ s/[\s\-]+/_/g; $self->{texts_reverse}->{$translation} ||= [ ]; push @{ $self->{texts_reverse}->{$translation} }, $original;