← Reference

string-methods

Ruby string-methods reference.

force_encoding

Re-label a string's encoding without altering its underlying bytes. Changes how Ruby interprets the string's content.

str.force_encoding(encoding)