Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1483

Show
Ignore:
Timestamp:
12/09/06 12:56:59
Author:
fumanchu
Message:

2.x Partial fix for #511 (wsgi default encoding).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/_cpwsgi.py

    r1439 r1483  
    9393            # not take any time at all if chunk is already of type "str". 
    9494            # If it's unicode, it could be a big performance hit (x ~500). 
    95             chunk = str(chunk) 
     95            if not isinstance(chunk, str): 
     96                chunk = chunk.encode("ISO-8859-1") 
    9697            yield chunk 
    9798        if request: 
     
    119120        # may raise its own error at that point). 
    120121        for chunk in b: 
    121             yield str(chunk) 
     122            if not isinstance(chunk, str): 
     123                chunk = chunk.encode("ISO-8859-1") 
     124            yield chunk 
    122125 
    123126 

Hosted by WebFaction

Log in as guest/cpguest to create tickets