From cc49596eb634c2295990e53e45f22a223c2db69c Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 16 Oct 2007 04:25:47 +0000 Subject: * string.c (rb_str_new4): should copy encoding. a patch from NARUSE, Yui . [ruby-dev:32076] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ string.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 775f4e0c5..33dabd659 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Oct 16 13:25:46 2007 Nobuyoshi Nakada + + * string.c (rb_str_new4): should copy encoding. a patch from NARUSE, + Yui . [ruby-dev:32076] + Tue Oct 16 01:31:23 2007 Yukihiro Matsumoto * enum.c (enum_inject): RDoc update. a patch from David Flanagan 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); -- cgit