Created
April 26, 2010 13:50
-
-
Save cypher/379346 to your computer and use it in GitHub Desktop.
This file contains 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
eschaton :: ~/Projects » cat scratch.rb | |
# encoding: utf-8 | |
str = "This is ä strïng with ümläuts in it" | |
regex = / (\p{Alpha}) / | |
puts __ENCODING__ | |
puts str.encoding | |
puts regex.encoding | |
if str =~ regex | |
puts "match: #{$1.inspect}" | |
else | |
puts "No match :(" | |
end | |
eschaton :: ~/Projects » rvm ruby scratch.rb | |
ruby-1.9.1-p376: ruby 1.9.1p376 (2009-12-07 revision 26041) [i386-darwin10.3.0] | |
UTF-8 | |
UTF-8 | |
UTF-8 | |
match: "ä" | |
ruby-1.9.2-preview1: ruby 1.9.2dev (2009-07-18 trunk 24186) [i386-darwin10.2.0] | |
UTF-8 | |
UTF-8 | |
UTF-8 | |
match: "ä" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment