[Zope-Checkins] CVS: Zope2 - PropertySheets.py:1.76
andreas@serenade.digicool.com
andreas@serenade.digicool.com
Fri, 6 Jul 2001 14:11:25 -0400
Update of /cvs-repository/Zope2/lib/python/OFS
In directory serenade:/tmp/cvs-serv6646
Modified Files:
PropertySheets.py
Log Message:
updated xml_escape() from 2.4 branch
--- Updated File PropertySheets.py in package Zope2 --
--- PropertySheets.py 2001/07/05 14:54:28 1.75
+++ PropertySheets.py 2001/07/06 18:11:24 1.76
@@ -814,8 +814,10 @@
(e.g. containing accented characters). Also we convert "<" and ">"
to entities to keep the properties XML compliant.
"""
-
- v = str(v).replace('<','<')
- v = v.replace('>','>')
+ v = str(v)
+
+ if v.count('<') != v.count('>'):
+ v = v.replace('<','<')
+ v = v.replace('>','>')
return unicode(v,"latin-1").encode("utf-8")