From b76d7afffc5f455bbe1b3fac95ed8f2c4a26fe42 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 16 Aug 2016 11:39:21 +0000 Subject: 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 --- transcode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'transcode.c') diff --git a/transcode.c b/transcode.c index 37934b5092..f474d903cb 100644 --- a/transcode.c +++ b/transcode.c @@ -2700,7 +2700,7 @@ str_transcode0(int argc, VALUE *argv, VALUE *self, int ecflags, VALUE ecopts) if (!NIL_P(ecopts)) { rep = rb_hash_aref(ecopts, sym_replace); } - dest = rb_str_scrub(str, rep); + dest = rb_enc_str_scrub(senc, str, rep); if (NIL_P(dest)) dest = str; *self = dest; return dencidx; -- cgit v1.2.3