Your Zope online help will help you.
For Python code, see the Products.PythonScripts.standard module, which includes html_quote()
For DTML, see the docs on dtml-var. Specifically, the html_quote attribute.
For ZPT, encoding is done automatically. You have to use structure keyword to stop it.
Zope maillist - Zope@zope.org
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce