Changeset 1382
- Timestamp:
- 09/27/06 17:14:32
- Files:
-
- trunk/cherrypy/lib/encoding.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/encoding.py
r1376 r1382 67 67 """ 68 68 def encoder(body): 69 for line in body: 70 yield line.encode(encoding, errors) 69 for chunk in body: 70 if isinstance(chunk, unicode): 71 chunk = chunk.encode(encoding, errors) 72 yield chunk 71 73 cherrypy.response.body = encoder(cherrypy.response.body) 72 74 return True … … 77 79 body = [] 78 80 for chunk in cherrypy.response.body: 79 body.append(chunk.encode(encoding, errors)) 81 if isinstance(chunk, unicode): 82 chunk = chunk.encode(encoding, errors) 83 body.append(chunk) 80 84 cherrypy.response.body = body 81 85 except (LookupError, UnicodeError):

