On Saturday 06 January 2007 07:37, Andreas Jung wrote:
> because Zope 2.10.2+ will use unicode as internal representation for
> page templates I am currently checking the options to get rid of
> UnicodeDecodeErrors for Zope 2.11 by providing some more intelligent
> conversion of non-unicode content. Basically I want if the content returned
> by expressions within a page template if unicode or non-unicode. If it is
> non-unicode it would be converted based on some policy (to be specified) to
> unicode. This would avoid any kind of UnicodeDecodeError (hopefully).
> This there a central place in the ZPT code were the evaluated expressions
> are inserted into the rendered HTML or some internal datastructure used for
> rending the ZPT? I just need to know where to look at but I have no idea so
> far :-)

Yeah, there is. The "engine" does all the expression evaluation work. It 
already handles the I18n stuff, so you should be able to do your unicode 
conversions there too.

The engine uses an expression context. This expression context has all sorts 
of ``evaluate*()`` methods. Most interesting to you will be the 
``evaluateText()`` one.

See ``zope.tales.tales``, ``zope.tales.engine``, 

I hope ... I am sure this is enough to get you started. :-)

Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-dev mailing list
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to