Alle Eingaben konvertieren & UTF8-Flag setzen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 10 Feb 2010 13:07:17 +0000 (14:07 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 4 Aug 2010 16:14:28 +0000 (18:14 +0200)
SL/Form.pm

index 29d2930..6ad6a92 100644 (file)
@@ -257,16 +257,10 @@ sub new {
   my $db_charset   = $main::dbcharset;
   $db_charset    ||= Common::DEFAULT_CHARSET;
 
-  if ($self->{INPUT_ENCODING}) {
-    if (lc $self->{INPUT_ENCODING} ne lc $db_charset) {
-      require Text::Iconv;
-      my $iconv = Text::Iconv->new($self->{INPUT_ENCODING}, $db_charset);
+  my $encoding     = $self->{INPUT_ENCODING} || $db_charset;
+  delete $self->{INPUT_ENCODING};
 
-      _recode_recursively($iconv, $self);
-    }
-
-    delete $self->{INPUT_ENCODING};
-  }
+  _recode_recursively(SL::Iconv->new($encoding, $db_charset), $self);
 
   $self->{action}  =  lc $self->{action};
   $self->{action}  =~ s/( |-|,|\#)/_/g;