- validate the text encoding and replace the text with a String#inspect

value if it is not valid.