Issue #1251 has been updated by Stephen Bannasch.


This sequence helped me understand the issue better:

>> a = b = "1_2_3"
=> "1_2_3"
>> for i in 0..b.length do print "#{b[i]} " end
49 95 50 95 51  => 0..5
>> b = a.gsub('_', '\\')
=> "1\\2\\3"
>> for i in 0..b.length do print "#{b[i]} " end
49 92 50 92 51  => 0..5
>> b = a.gsub('_', '\\\\')
=> "1\\2\\3"
>> for i in 0..b.length do print "#{b[i]} " end
49 92 50 92 51  => 0..5
>> b = a.gsub('_', '\\\\\\')
=> "1\\\\2\\\\3"
>> for i in 0..b.length do print "#{b[i]} " end
49 92 92 50 92 92 51  => 0..7


----------------------------------------
http://redmine.ruby-lang.org/issues/show/1251

----------------------------------------
http://redmine.ruby-lang.org