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 d0f08a3f42..134d65b822 100644
--- a/string.c
+++ b/string.c
@@ -725,6 +725,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;
}