On Wed, Jun 16, 2010 at 12:50 AM, Jason J. W. Williams
<[email protected]> wrote:
> Hi Y'all,
>
> What's the correct way to write out Unicode data to the client in
> Twisted Web? request.write() throws a "Data must not be unicode".
> Content-Type header is set with "; charset=utf-8" appended to the
> content type.

Encode it to bytes with ustr.encode("utf-8") and then pass it to request.write.

-- 
Christopher Armstrong
http://radix.twistedmatrix.com/
http://planet-if.com/

_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python

Reply via email to