[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/OFS/Content/ZPTPage - ZPTPage.py:1.3

Jim Fulton jim@zope.com
Wed, 3 Jul 2002 09:30:44 -0400


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Content/ZPTPage
In directory cvs.zope.org:/tmp/cvs-serv8118

Modified Files:
	ZPTPage.py 
Log Message:
Added code to encode unicode editing input to utf-8 because page
templates expect string text.

This was necessary to make editing work.


=== Zope3/lib/python/Zope/App/OFS/Content/ZPTPage/ZPTPage.py 1.2 => 1.3 ===
     def setSource(self, text, content_type='text/html'):
         '''See interface IZPTPage'''
+
+        if isinstance(text, unicode):
+            text = text.encode('utf-8')
+        
         self.pt_edit(text, content_type)
 
     #