Test EncodedSring#to_s for undefined conversion / invalid byte sequence

Related to https://github.com/rspec/rspec-core/pull/1760
taken from https://github.com/ruby/ruby/blob/34fbf57aaafee9390a0f7427eb90efac099e33ec/test/ruby/test_transcode.rb#L2050

it's, if i understand, an alternative to `:undef =? :replace`