Skip to content

Instantly share code, notes, and snippets.

@tian-im
Created September 18, 2017 06:20
Show Gist options
  • Save tian-im/8d9d28b892d9534c4df9c35c7e384337 to your computer and use it in GitHub Desktop.
Save tian-im/8d9d28b892d9534c4df9c35c7e384337 to your computer and use it in GitHub Desktop.
Detect non-ASCII charaters
"‐a".each_codepoint do |c|
if c & 0xff80 != 0
puts "#{c} is non-ASCII char"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment