Issue #825 resolved

cherrypy HTTPRedirect does not handle unicode urls

created an issue

Unicode urls are not correctly handled via HTTPRedirect.



raise HTTPRedirect(u"/appname/\xa3")


This should really be:


but is instead rendered as:



Encode the URL using a user-configurable site-wide encoding (which defaults to utf8?)

Comments (7)

  1. Anonymous

    Personally I believe it is up to the application to provide an encoded byte string. It'd a burden for most cases to require CP to guess which encoding to use in the first place.

    The idea of a config entry is not the right choice:

    1. Adding even more parameters to the config will not improve CP's usability 2. What happens when URLs are dynamically constructed out of different encodings?

    Updating the doc. in such case would be enough of a fix here.

  2. Robert Brewer

    I tend to agree. However, UTF8 is rapidly gaining traction as the default encoding for IRI's, HTTP, and XHTML. It might be good to default to UTF-8 sometime in the future.

  3. Log in to comment