use Encode; sub test { my $x = shift; my $y = Encode::decode('iso-8859-1', $x); if ($x eq $y) { return 1; } else { return 0; } }