Validate the string to be decoded.