aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-16 04:25:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-10-16 04:25:47 +0000
commiteb6e9c15bd5f4ea664bd1f7a336a0512b21f9a37 (patch)
tree4fd8c75196d2bef7b5a5f510754f4e8ea0d084ad /string.c
parent8cb190c41634fdc0079b24be76291c83fdd282ca (diff)
downloadruby-eb6e9c15bd5f4ea664bd1f7a336a0512b21f9a37.tar.gz
* string.c (rb_str_new4): should copy encoding. a patch from NARUSE,
Yui <naruse AT airemix.com>. [ruby-dev:32076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 19edb8cae0..40450bc17c 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);