test_m17n.rb: split tests for inspect

* test/ruby/test_m17n.rb (test_utf_16_32_inspect): split tests for
  each encodings.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
string.c: use actual encodings

* string.c (get_actual_encoding): get actual encoding according to
  the BOM if exists.
* string.c (rb_str_inspect): use according encoding, instead of
  pseudo encodings, UTF-{16,32}.  [ruby-core:59757] [Bug #8940]

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

* string.c (get_encoding): respect BOM on pseudo encodings.
  [ruby-dev:47895] [Bug #9415]

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