Below is how you can detect non-ascii characters with javascript.
s = $("#something").val(); for (var i=0; n= 128) { alert('Invalid character '' + String.fromCharCode(c) + '''); return false; // or throw an error } }
Of course if you have to take in non-ascii values, then be prepared to set up your environments first. The links below will help.
http://us.php.net/manual/en/function.base64-encode.php
http://pureform.wordpress.com/2008/03/23/make-your-website-completely-utf-8-friendly/