1 """This is a copy of the htmlEncode function in Webware.
4 @@TR: It implemented more efficiently.
13 htmlCodesReversed
= htmlCodes
[:]
14 htmlCodesReversed
.reverse()
16 def htmlEncode(s
, codes
=htmlCodes
):
17 """ Returns the HTML encoded version of the given string. This is useful to
18 display a plain ASCII text string on a web page."""
20 s
= s
.replace(code
[0], code
[1])