[ZPT] CVS: Zope/lib/python/TAL - DummyEngine.py:1.32.8.2 TALInterpreter.py:1.69.6.1.2.2

Florent Guillaume fg@nuxeo.com
Sun, 15 Sep 2002 20:00:48 -0400


Update of /cvs-repository/Zope/lib/python/TAL
In directory cvs.zope.org:/tmp/cvs-serv1822/TAL

Modified Files:
      Tag: Zope-2_6-i18n-branch
	DummyEngine.py TALInterpreter.py 
Log Message:
Improved support for Unicode in TAL and ZPT.
Added tests that exercise that.


=== Zope/lib/python/TAL/DummyEngine.py 1.32.8.1 => 1.32.8.2 ===
--- Zope/lib/python/TAL/DummyEngine.py:1.32.8.1	Sun Sep 15 18:43:34 2002
+++ Zope/lib/python/TAL/DummyEngine.py	Sun Sep 15 20:00:46 2002
@@ -20,6 +20,7 @@
 
 from TALDefs import NAME_RE, TALESError, ErrorInfo
 from ITALES import ITALESCompiler, ITALESEngine
+from DocumentTemplate.DT_Util import ustr
 try:
     from Zope.I18n.ITranslationService import ITranslationService
     from Zope.I18n.IDomain import IDomain
@@ -137,7 +138,7 @@
     def evaluateText(self, expr):
         text = self.evaluate(expr)
         if text is not None and text is not Default:
-            text = str(text)
+            text = ustr(text)
         return text
 
     def evaluateStructure(self, expr):


=== Zope/lib/python/TAL/TALInterpreter.py 1.69.6.1.2.1 => 1.69.6.1.2.2 ===
--- Zope/lib/python/TAL/TALInterpreter.py:1.69.6.1.2.1	Sun Sep 15 18:43:34 2002
+++ Zope/lib/python/TAL/TALInterpreter.py	Sun Sep 15 20:00:46 2002
@@ -22,6 +22,7 @@
 from cgi import escape
 # Do not use cStringIO here!  It's not unicode aware. :(
 from StringIO import StringIO
+from DocumentTemplate.DT_Util import ustr
 
 from TALDefs import quote, TAL_VERSION, TALError, METALError
 from TALDefs import isCurrentVersion, getProgramVersion, getProgramMode
@@ -548,7 +549,7 @@
         if structure is self.Default:
             self.interpret(block)
             return
-        text = str(structure)
+        text = ustr(structure)
         if not (repldict or self.strictinsert):
             # Take a shortcut, no error checking
             self.stream_write(text)