def __next__(self):
        """UTF-8-encode the next chunk of the stream."""
        res = next(self._iterator)
        if isinstance(res, str):
            res = res.encode('utf-8')
        return res
UTF-8-encode the next chunk of the stream.
cherrypy/lib/encoding.py