[Twisted-Python] Twisted Web, Unicode & request.write()
radix at twistedmatrix.com
Wed Jun 16 02:13:49 EDT 2010
On Wed, Jun 16, 2010 at 12:50 AM, Jason J. W. Williams
<jasonjwwilliams at gmail.com> 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.
More information about the Twisted-Python