From 8fb925dfcd34bac51026cfa04ac4108a23b53e5d Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 19 May 2014 07:29:51 +0000 Subject: string.c: byte offset * string.c (rb_pat_search): advance by byte offset but not by char offset. [ruby-core:62669] [Bug #9849] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_string.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_string.rb b/test/ruby/test_string.rb index 3539a3eace..ed1ca895df 100644 --- a/test/ruby/test_string.rb +++ b/test/ruby/test_string.rb @@ -834,6 +834,9 @@ class TestString < Test::Unit::TestCase assert_equal Encoding::UTF_8, a.gsub(/world/, c).encoding assert_equal S("a\u{e9}apos<"), S("a\u{e9}'<").gsub("'", "apos") + + bug9849 = '[ruby-core:62669] [Bug #9849]' + assert_equal S("\u{3042 3042 3042}!foo!"), S("\u{3042 3042 3042}/foo/").gsub("/", "!"), bug9849 end def test_gsub! -- cgit v1.2.3