string.c: coderange appending to empty string

* string.c (rb_enc_cr_str_buf_cat, rb_str_append): consider an empty
  string 7bit-clean and should not discard cached coderange of string
  to be appended.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
stringio.c: keep coderange

* ext/stringio/stringio.c (strio_write): keep coderange of
  ptr->string.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
csv.rb: get rid of discarding coderange

* lib/csv.rb (CSV#<<): use StringIO#set_encoding instead of creating
  new StringIO instance with String#force_encoding, forcing encoding
  discards the cached coderange bits and can make further operations
  very slow.  [ruby-core:55714] [Bug #8585]

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