[PATCH 2/2] No-op the EncodeUnicode filter when it encounters a unicode() object.
"R. Tyler Ballance" <[email protected]> Fri, 16 Oct 2009 15:27:45 -0700
| Newsgroups | gmane.comp.python.cheetah |
|---|---|
| Message-ID | <[email protected]> |
Since v2.2.0, the handling of unicode objects has been
gracefully handled by Cheetah, such that the encoding operation
here is unnecessary (and likely an additional performance hindrance)
---
cheetah/Filters.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/cheetah/Filters.py b/cheetah/Filters.py
index dd65f28..452afc5 100644
--- a/cheetah/Filters.py
+++ b/cheetah/Filters.py
@@ -58,7 +58,7 @@ class EncodeUnicode(Filter):
>>> print t
"""
if isinstance(val, unicode):
- return val.encode(encoding)
+ return val
if val is None:
return ''
return str(val)
--
1.6.5
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference