Created
November 3, 2012 14:02
-
-
Save rjsamson/4007461 to your computer and use it in GitHub Desktop.
Illustration of Rubinius Encoding Issues with Substring Ranges
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
puts "Substring Range Test" | |
str = "utf-8 character (\u20AC) in a utf-8 string" | |
str2 = "normal ASCII-ONLY string" | |
puts "str: #{str}" | |
puts "str2: #{str2}" | |
puts "str[1...-1]: #{str[1...-1]}" # => "tf-8 character (€) in a utf-8 string" | |
puts "str2[1...-1]: #{str2[1...-1]}" # => "ormal ASCII-ONLY Strin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment