mirror of
https://github.com/ruby/ruby.git
synced 2025-08-28 15:36:16 +02:00
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
This commit is contained in:
parent
72c773b15d
commit
8fb925dfcd
3 changed files with 15 additions and 5 deletions
|
@ -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!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue