<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_payload(self, payload, charset=None):
 """Set the payload to the given value. Optional charset sets the message's default character set. See set_charset() for details. """

        self._payload = payload
        if charset is not None:
            self.set_charset(charset)