use Encode; my $t = "abc"; my $d = decode('ascii',$t); printf "is_utf8=%d\n", (utf8::is_utf8($d) ? 1 : 0);