Skip to content

Instantly share code, notes, and snippets.

@marcusshepp
Created May 2, 2016 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusshepp/2a23d7eaa471225fcc2b8fc63c2dc7df to your computer and use it in GitHub Desktop.
Save marcusshepp/2a23d7eaa471225fcc2b8fc63c2dc7df to your computer and use it in GitHub Desktop.
Javascript check for non-ascii chars
function is_ascii(str){
for (var i = 0; i < str.length; i++)
if (str.charCodeAt(i) > 127)
return false;
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment