Hi, Assuming your string is in $str, try this:
if ($str =~ /[^!-~\s]/g){print "Non-ASCII character found"}
This will check for any other character apart from ASCII character.
In reply to Re: testing if a string is ascii
by rsriram
in thread testing if a string is ascii
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |