summaryrefslogtreecommitdiff
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 7d865d669a..e16b4291d8 100644
--- a/string.c
+++ b/string.c
@@ -726,6 +726,7 @@ static VALUE
str_new_empty(VALUE str)
{
VALUE v = rb_str_new5(str, 0, 0);
+ rb_enc_copy(v, str);
OBJ_INFECT(v, str);
return v;
}