From 0d0636d22ce7bd4729d749ca36cf2cde5175d815 Mon Sep 17 00:00:00 2001 From: yugui Date: Mon, 20 Dec 2010 13:22:48 +0000 Subject: merges r29848 and r29852 from trunk into ruby_1_9_2. -- * string.c (rb_str_concat): set ENC_CODERANGE_VALID when the receiver is 7BIT and the argument is non ASCII. -- Fix r29848's test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@30261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'string.c') diff --git a/string.c b/string.c index cdb919939b..1aae6120aa 100644 --- a/string.c +++ b/string.c @@ -2026,6 +2026,8 @@ rb_str_concat(VALUE str1, VALUE str2) } rb_str_resize(str1, pos+len); rb_enc_mbcput(lc, RSTRING_PTR(str1)+pos, enc); + if (cr == ENC_CODERANGE_7BIT && lc > 127) + cr = ENC_CODERANGE_VALID; ENC_CODERANGE_SET(str1, cr); return str1; } -- cgit v1.2.3