← Reference

string-methods

Ruby string-methods reference.

String#valid_encoding?

Returns true if the string bytes are valid for its current encoding, false otherwise.

str.valid_encoding? → true or false