path: root/transcode.c
diff options
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-27 08:09:46 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-05-27 08:09:46 (GMT)
commit4fad63da01789ad3b562833c97d289d2abfeff19 (patch)
tree0916ba45ffe09bec9cc8406b860c9dca27eec0c5 /transcode.c
parentbe1ceb27234815628631524d23cdb6c518a73044 (diff)
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:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/transcode.c b/transcode.c
index 0514ada..8aa9cf3 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;