in reply to Detecting Strange Characters in Text?

You probably want to decide what you want to keep, rather than what you want to throw away, as the latter will probably be huge.

See perlre. You can use a regexp to pull out a range of acceptable ascii values.
  • Comment on Re: Detecting Strange Characters in Text?

Replies are listed 'Best First'.
Re^2: Detecting Strange Characters in Text?
by Anonymous Monk on Jun 16, 2005 at 17:07 UTC
    Actually I think in this case the allowable set will probably be larger. So to get rid of the 225, I can just run something like
    $text =~ s/\xE1//g;
    ?
      #!/usr/bin/perl use warnings; use strict; my $text = "ßeta"; print $text, "\n"; $text =~ s/\xDF//; print $text, "\n"; __OUTPUT__ ßeta eta
      Although it would be more robust to follow something similar to what jacques suggested.