From ab2128729fd387e44d6c791a6132abdad2c25a76 Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 9 Feb 2008 01:04:29 +0000 Subject: * string.c (rb_str_new4): copy encoding from orig, instead of shared one. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 1 + 1 file changed, 1 insertion(+) (limited to 'string.c') diff --git a/string.c b/string.c index e24ca623d..2bec884be 100644 --- a/string.c +++ b/string.c @@ -425,6 +425,7 @@ rb_str_new4(VALUE orig) RSTRING(str)->as.heap.ptr += ofs; RSTRING(str)->as.heap.len -= ofs; } + rb_enc_copy(str, orig); OBJ_INFECT(str, orig); } else if (STR_EMBED_P(orig)) { -- cgit