Ruby string-methods reference.
Returns true if the string bytes are valid for its current encoding, false otherwise.
str.valid_encoding? → true or false