in reply to testing if a string is ascii
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: testing if a string is ascii
by Skeeve (Parson) on Sep 04, 2006 at 06:29 UTC | |
|
Re^2: testing if a string is ascii
by earlati2 (Beadle) on Sep 04, 2006 at 07:20 UTC | |
by rsriram (Hermit) on Sep 04, 2006 at 10:09 UTC |