The perl-way:
#!/usr/bin/perl
opendir(DIR,".") or die "$@:$!";
while ($in = readdir(DIR)) {
  next unless -f $in;
  ($out = $in) =~ s/[^a-zA-Z0-9._-]//g;
  warn "$@:$!" unless rename $in, $out;
}
closedir(DIR);
The regex filters onleonly a-zA-Z ... (could also be [:print:] for printable chars) as valid chars, there. There is no checking for empty target names.