Changeset 1517
- Timestamp:
- 12/11/06 13:34:41
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/cherrypy-2.x/cherrypy/filters/encodingfilter.py
r1480 r1517 27 27 """ 28 28 def encoder(body): 29 for line in body: 30 yield line.encode(encoding, errors) 29 for chunk in body: 30 if isinstance(chunk, unicode): 31 chunk = chunk.encode(encoding, errors) 32 yield chunk 31 33 cherrypy.response.body = encoder(cherrypy.response.body) 32 34 return True … … 37 39 body = [] 38 40 for chunk in cherrypy.response.body: 39 body.append(chunk.encode(encoding, errors)) 41 if isinstance(chunk, unicode): 42 chunk = chunk.encode(encoding, errors) 43 body.append(chunk) 40 44 cherrypy.response.body = body 41 45 except (LookupError, UnicodeError):

