[Zope-Checkins] SVN: Zope/trunk/lib/python/ZPublisher/HTTPResponse.py Allow encoding of application/xhtml+xml pages according to the charset

Florent Guillaume fg at nuxeo.com
Fri Nov 26 12:33:32 EST 2004


Log message for revision 28520:
  Allow encoding of application/xhtml+xml pages according to the charset
  specified in the Content-Type header. (Collector #1510)
  

Changed:
  U   Zope/trunk/lib/python/ZPublisher/HTTPResponse.py

-=-
Modified: Zope/trunk/lib/python/ZPublisher/HTTPResponse.py
===================================================================
--- Zope/trunk/lib/python/ZPublisher/HTTPResponse.py	2004-11-26 17:28:30 UTC (rev 28519)
+++ Zope/trunk/lib/python/ZPublisher/HTTPResponse.py	2004-11-26 17:33:32 UTC (rev 28520)
@@ -433,7 +433,7 @@
         return self.use_HTTP_content_compression
 
     def _encode_unicode(self,body,
-                        charset_re=re.compile(r'text/[0-9a-z]+\s*;\s*' +
+                        charset_re=re.compile(r'(?:application|text)/[-+0-9a-z]+\s*;\s*' +
                                               r'charset=([-_0-9a-z]+' +
                                               r')(?:(?:\s*;)|\Z)',
                                               re.IGNORECASE)):



More information about the Zope-Checkins mailing list