Browse files

fixed another unicode issue in template.py (Bug#180510)

  • Loading branch information...
1 parent 3c82303 commit 2eb1b9c71d3aa91a12e6ffbfcfe7e520da6c12df @anandology anandology committed Jan 19, 2008
Showing with 4 additions and 2 deletions.
  1. +4 −2 web/template.py
View
6 web/template.py
@@ -678,7 +678,7 @@ def h_line(self, i):
out = []
for x in i[THING]:
if isinstance(x, (unicode, str)):
- out.append(x)
+ out.append(utf8(x))
elif x[WHAT] == 'itpl':
o = self.h(x[NAME])
if x[FILTER]:
@@ -873,8 +873,10 @@ def test():
'1\n'
>>> t('$def with (a)\n$a')(u'\u203d')
'\xe2\x80\xbd\n'
+ >>> t(u'$def with (a)\n$a $:a')(u'\u203d')
+ '\xe2\x80\xbd \xe2\x80\xbd\n'
>>> t(u'$def with ()\nfoo')()
- u'foo\n'
+ 'foo\n'
>>> def f(x): return x
...
>>> t(u'$def with (f)\n$:f("x")')(f)

0 comments on commit 2eb1b9c

Please sign in to comment.