[Zope-Checkins] SVN: Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py set output-encoding for uploaded XML files always to UTF-8

Andreas Jung andreas at andreas-jung.com
Sun Dec 17 13:46:13 EST 2006


Log message for revision 71570:
  set output-encoding for uploaded XML files always to UTF-8
  

Changed:
  U   Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py

-=-
Modified: Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py
===================================================================
--- Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py	2006-12-17 18:45:41 UTC (rev 71569)
+++ Zope/branches/ajung-zpt-encoding-fixes/lib/python/Products/PageTemplates/ZopePageTemplate.py	2006-12-17 18:46:12 UTC (rev 71570)
@@ -305,7 +305,10 @@
         text = REQUEST.get('BODY', '')
         content_type = guess_type('', text) 
         encoding = sniffEncoding(text, self.output_encoding)
-        self.output_encoding = encoding
+        if content_type == 'text/xml':
+            self.output_encoding = 'utf-8'
+        else:   
+            self.output_encoding = encoding
         self.pt_edit(text, content_type, encoding)
         RESPONSE.setStatus(204)
         return RESPONSE



More information about the Zope-Checkins mailing list