def decode_entity(self, value):
        """Return a given byte encoded value as a string."""
        for charset in self.attempt_charsets:
            try:
                value = value.decode(charset)
            except UnicodeDecodeError:
                pass
            else:
                self.charset = charset
                return value
        else:
            raise cherrypy.HTTPError(
                400,
                'The request entity could not be decoded. The following '
                'charsets were attempted: %s' % repr(self.attempt_charsets),
            )
Return a given byte encoded value as a string.
cherrypy/_cpreqbody.py