Issue #8512 has been reported by galnaktar (Oleg K).

----------------------------------------
Bug #8512: gsub() works incorrect 
https://bugs.ruby-lang.org/issues/8512

Author: galnaktar (Oleg K)
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN


irb(main):005:0> "\\".gsub("\\", "\\\\").length 
=> 1 
irb(main):006:0> "\\".gsub("\\", "XX").length 
=> 2

bug is duplicated with rejected bug #8511


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