@staticmethod
    def _handle_utf8_payload(body, properties):
        """Update the Body and Properties to the appropriate encoding.

        :param str|unicode body:
        :param dict properties:
        :return:
        """
        if compatibility.is_unicode(body):
            if properties not in 'content_encoding':
                properties['content_encoding'] = 'utf-8'
            encoding = properties['content_encoding']
            body = body.encode(encoding)
        elif compatibility.PYTHON3 and isinstance(body, str):
            body = bytes(body, encoding='utf-8')
        return body
dataset/ETHPy150Open eandersson/amqpstorm/amqpstorm/basic.py/Basic._handle_utf8_payload/swapped operands of `not in`