aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index c45179f58d..aef65e74c7 100644
--- a/string.c
+++ b/string.c
@@ -520,6 +520,7 @@ rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags,
len = RSTRING_LEN(str);
newstr = rb_str_new(0, len);
+ OBJ_INFECT(newstr, str);
olen = len;
econv_wrapper = rb_obj_alloc(rb_cEncodingConverter);