aboutsummaryrefslogtreecommitdiffstats
path: root/transcode.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-27 08:09:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-27 08:09:46 +0000
commit62e161c7ea5752e4a5a7893908262a5b8126b277 (patch)
tree0916ba45ffe09bec9cc8406b860c9dca27eec0c5 /transcode.c
parentbc278d437ef49b25e8de6fff927d9641f2b54735 (diff)
downloadruby-62e161c7ea5752e4a5a7893908262a5b8126b277.tar.gz
transcode.c: scrub in the given encoding
* 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/trunk@55181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r--transcode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/transcode.c b/transcode.c
index 0514adaf7e..8aa9cf3352 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;