Created
August 6, 2011 22:55
-
-
Save donpdonp/1129851 to your computer and use it in GitHub Desktop.
match and UTF-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby-1.9.2-p290 :008 > line="Welcome to leguin.freenode.net in Ume\xE5, Sweden, EU!" | |
=> "Welcome to leguin.freenode.net in Ume\xE5, Sweden, EU!" | |
ruby-1.9.2-p290 :011 > line.encoding | |
=> #<Encoding:UTF-8> | |
ruby-1.9.2-p290 :010 > /^$/.match("abc") | |
=> nil | |
ruby-1.9.2-p290 :009 > /^$/.match(line) | |
ArgumentError: invalid byte sequence in UTF-8 | |
from (irb):9:in `match' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment