I'm not certain how PHP deals with non-ascii characters, but I bet you could get away with using pattern matching. If you want to remove all non-ascii characters, then you need to use [man]preg_replace[/man]. If you just want to know if a given word has any characters outside that set you specified, you should use [man]preg_match[/man].
this might get rid of characters that aren't in your specified set
function remove_weird_chars($str) {
$pattern = "/[^a-zA-z0-9@?#%!&~ .]/";
$result = preg_replace($pattern, '', $str);
return $result;
}