class RSpec::Support::EncodedString

def remove_invalid_bytes(string)

https://github.com/rubinius/rubinius/blob/v2.5.2/kernel/common/string.rb#L1913-L1972
https://github.com/hsbt/string-scrub
https://github.com/ruby/ruby/blob/v2_1_0/string.c#L8242
https://github.com/ruby/ruby/blob/eeb05e8c11/doc/NEWS-2.1.0#L120-L123
def remove_invalid_bytes(string)
  string.scrub(REPLACE)
end