encoding.c: terminator in enc_set_index

* encoding.c (enc_set_index): deal with terminator so that
  rb_enc_set_index also works.

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

* encoding.c (enc_inspect): use PRIsVALUE to preserve the result
  encoding.

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
string.c: consider old terminator

* string.c (str_fill_term): consider old terminator length, and should
  not use rb_enc_ascget since it depends on the current encoding which
  may not be compatible with the new terminator.  [Bug #8634]

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