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

Changeset 1090

Show
Ignore:
Timestamp:
05/02/06 18:34:15
Author:
fumanchu
Message:

Partial fix for #511 (wsgi default encoding).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cpwsgi.py

    r1082 r1090  
    9595            # not take any time at all if chunk is already of type "str". 
    9696            # If it's unicode, it could be a big performance hit (x ~500). 
    97             chunk = str(chunk) 
     97            if not isinstance(chunk, str): 
     98                chunk = chunk.encode("ISO-8859-1") 
    9899            yield chunk 
    99100        if request: 
     
    121122        # may raise its own error at that point). 
    122123        for chunk in b: 
    123             yield str(chunk) 
     124            if not isinstance(chunk, str): 
     125                chunk = chunk.encode("ISO-8859-1") 
     126            yield chunk 
    124127 
    125128 

Hosted by WebFaction

Log in as guest/cpguest to create tickets