merge revision(s) r46345,r46346: [Backport #9903]

	re.c: reduce new strings

	* re.c (match_aref, rb_reg_regsub): reduce new strings creation
  for exceptions.
	* re.c (match_aref, rb_reg_regsub): consider encoding of captured
	  names, encoding-incompatible should not match.
	  [ruby-dev:48278] [Bug #9903]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@47052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e