summaryrefslogtreecommitdiffstats
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 19edb8cae..40450bc17 100644
--- a/string.c
+++ b/string.c
@@ -307,6 +307,7 @@ rb_str_new4(VALUE orig)
}
else if (STR_ASSOC_P(orig) || STR_EMBED_P(orig)) {
str = str_new(klass, RSTRING_PTR(orig), RSTRING_LEN(orig));
+ rb_enc_copy(str, orig);
}
else {
str = str_new4(klass, orig);