Re: [Zope3-dev] Re: Some ZPT insights needed

2007-01-07 Thread Dieter Maurer
Martijn Faassen wrote at 2007-1-6 20:34 +0100:
 
This kind of automagic unicode error defeating logic scares me.

Andreas decided to switch to Unicode only page templates in
a micro (!) release.
As almost all Zope 2 applications return non-unicode strings
(they almost had to as the page templates usually were non-unicode),
he *MUST* provide some automatic unicode error defeating logic
as otherwise most applications would break.

 
I'd therefore like it if there were a way, application-root specific, to 
turn off any auto-conversion behavior. Do you think that would be possible?

+1



-- 
Dieter
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] Re: Some ZPT insights needed

2007-01-06 Thread Martijn Faassen

Andreas Jung wrote:

Hi,

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 :-)


This kind of automagic unicode error defeating logic scares me. With 
Silva, we have a significant Zope 2 application that already takes care 
to output unicode to the page template engine. For a while we were using 
PlacelessTranslationService which has some hacks in place to do 
automagic conversion from unicode to an encoding. Granted this is the 
opposite direction than you are proposing, and my intuition is that your 
direction may be less scary, but I'm still scared. Not having unicode 
errors can make debugging of pure-unicode applications harder. Bugs 
sneak in pretty easily and you end up with non-pure content.


I'd therefore like it if there were a way, application-root specific, to 
turn off any auto-conversion behavior. Do you think that would be possible?


Regards,

Martijn


___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com