def test_rawHeadersValueEncoding(self):
        """
        Passing L{unicode} to L{Headers.setRawHeaders} will encode the name as
        ISO-8859-1 and values as UTF-8.
        """
        h = Headers()
        h.setRawHeaders(u"\u00E1", [u"\u2603", b"foo"])
        self.assertTrue(h.hasHeader(b"\xe1"))
        self.assertEqual(h.getRawHeaders(b"\xe1"), [b'\xe2\x98\x83', b'foo'])

        Passing L{unicode} to L{Headers.setRawHeaders} will encode the name as
        ISO-8859-1 and values as UTF-8.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_http_headers.py