Skip to content

Instantly share code, notes, and snippets.

@mperham
Created May 3, 2010 15:43
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 mperham/388206 to your computer and use it in GitHub Desktop.
Save mperham/388206 to your computer and use it in GitHub Desktop.
# \u00A0 is a Unicode non-breaking space and \s should match it if everything is Unicode-# enabled.
> irb
>> RUBY_VERSION
=> "1.9.1"
>> "\u00A0"
=> " "
>> s = _
=> " "
>> s.bytes.to_a
=> [194, 160]
>> s =~ /\s/
=> nil
>> s.encoding
=> #<Encoding:UTF-8>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment