[ZPT] Coerce result using unicode() rather than str() ?

Chris Withers chris at simplistix.co.uk
Mon Jul 12 09:19:35 EDT 2004


Stuart Bishop wrote:
> if not isinstance(result, (str, unicode)):
>     if hasattr(result, '__unicode__'):
>         return unicode(result)
>     else:
>         return str(result)
> 
> (Hmm... would this be in ZPT or ZPublisher?)

Probably TALES.py somewhere...

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the ZPT mailing list