summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-16 11:39:21 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-08-16 11:39:21 +0000
commitb76d7afffc5f455bbe1b3fac95ed8f2c4a26fe42 (patch)
tree0a244ca3c43c9edd11d37c6a4278f5f43cdbf1c8 /test
parentef62988ecce58edc1ffbd6aa70ffd328a03b0923 (diff)
merge revision(s) 55181: [Backport #12431]
* transcode.c (str_transcode0): scrub in the given encoding when the source encoding is given, not in the encoding of the receiver. [ruby-core:75732] [Bug #12431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@55936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_transcode.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_transcode.rb b/test/ruby/test_transcode.rb
index 4bade11a51..fbc196925f 100644
--- a/test/ruby/test_transcode.rb
+++ b/test/ruby/test_transcode.rb
@@ -1212,6 +1212,9 @@ class TestTranscode < Test::Unit::TestCase
def test_invalid_replace_string
assert_equal("a<x>A", "a\x80A".encode("us-ascii", "euc-jp", :invalid=>:replace, :replace=>"<x>"))
assert_equal("a<x>A", "a\x80A".encode("us-ascii", "euc-jis-2004", :invalid=>:replace, :replace=>"<x>"))
+ s = "abcd\u{c1}"
+ r = s.b.encode("UTF-8", "UTF-8", invalid: :replace, replace: "\u{fffd}")
+ assert_equal(s, r)
end
def test_undef_replace