aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--string.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 775f4e0c51..33dabd6596 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Oct 16 13:25:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * string.c (rb_str_new4): should copy encoding. a patch from NARUSE,
+ Yui <naruse AT airemix.com>. [ruby-dev:32076]
+
Tue Oct 16 01:31:23 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (enum_inject): RDoc update. a patch from David Flanagan
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);