Changeset 1306
- Timestamp:
- 09/01/06 11:46:53
- Files:
-
- trunk/cherrypy/lib/http.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/http.py
r1296 r1306 347 347 for v in value: 348 348 if isinstance(v, unicode): 349 # Encode RFC-2047 TEXT (e.g. u"\u8200" -> "=?utf-8?b?6IiA?="). 349 # HTTP/1.0 says, "Words of *TEXT may contain octets 350 # from character sets other than US-ASCII." and 351 # "Recipients of header field TEXT containing octets 352 # outside the US-ASCII character set may assume that 353 # they represent ISO-8859-1 characters." 350 354 try: 351 355 v = v.encode("iso-8859-1") 352 356 except UnicodeEncodeError: 353 # HTTP/1.0 says, "Words of *TEXT may contain octets354 # from character sets other than US-ASCII." and355 # "Recipients of header field TEXT containing octets356 # outside the US-ASCII character set may assume that357 # they represent ISO-8859-1 characters."358 357 if protocol >= (1, 1): 359 v = v.encode("utf-8") 358 # Encode RFC-2047 TEXT 359 # (e.g. u"\u8200" -> "=?utf-8?b?6IiA?="). 360 360 v = Header(v, 'utf-8').encode() 361 361 else:

