Changeset 160
- Timestamp:
- 04/25/05 04:11:46
- Files:
-
- trunk/cherrypy/lib/filter/tidyfilter.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/filter/tidyfilter.py
r108 r160 51 51 cpg.response.body = [originalBody] 52 52 53 ct = cpg.response.headerMap.get('Content-Type').split(';')[0] 53 fct = cpg.response.headerMap.get('Content-Type', '') 54 ct = fct.split(';')[0] 54 55 if ct == 'text/html': 55 56 pageFile = os.path.join(self.tmpDir, 'page.html') … … 59 60 f.write(originalBody) 60 61 f.close() 61 encoding = cpg.response.headerMap.get('Content-Encoding', '') 62 encoding = '' 63 i = fct.find('charset=') 64 if i != -1: 65 encoding = fct[i+8:] 66 encoding = encoding.replace('utf-8', 'utf8') 62 67 if encoding: 63 encoding = '- u' + encoding68 encoding = '-' + encoding 64 69 os.system('"%s" %s -f %s -o %s %s' % ( 65 70 self.tidyPath, encoding, errFile, outFile, pageFile))

