Issue #703 resolved

WSGI application barfs on unicode output

guest
created an issue

The webapp I wrote can generate HTML that contains Japanese kanji. When trying to move from CherryPy 2.2.1 to 3.0.1, my application stopped working.

{{{ tools.decode.on = True tools.decode.encoding = 'utf-8' tools.encode.on = True tools.encode.encoding = 'utf-8'

[04/Jul/2007:13:38:08] Traceback (most recent call last): File ".../site-packages/cherrypy/_cpwsgi.py", line 175, in next chunk = chunk.encode("ISO-8859-1") UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2122' in position 14359: ordinal not in range(256) }}}

Comments (3)

  1. Robert Brewer

    First, what Content-Type are you serving for such pages? The encoding tool only works if ct.value.lower().startswith("text/").

    Otherwise, I'd bet there's a problem with your config. Can you post a stripped-down demo of the problem?

  2. Log in to comment