Created
July 13, 2011 14:35
-
-
Save everton/1080407 to your computer and use it in GitHub Desktop.
jRuby bug with encoding
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
#-*- coding: utf-8 -*- | |
str = "<h1>Bugs#index</h1> | |
<%= @user %> | |
<p>á</p>" | |
str =~ /(?m-ix:<%(=+|-|\#|%)?(.*?)([-=])?%>([ \t]*\r?\n)?)/ | |
match = Regexp.last_match() | |
puts match.begin(0) | |
puts match.end(0) | |
# $ rvm use jruby-1.6.3 | |
# Using /home/everton/.rvm/gems/jruby-1.6.3 | |
# $ ruby test.rb | |
# 21 | |
# 0 | |
# $ rvm use ruby-1.9.2 | |
# Using /home/everton/.rvm/gems/ruby-1.9.2-p180 | |
# $ ruby test.rb | |
# 21 | |
# 34 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment