def escapeit(self, sval, EXTRAS=None): # note, xmlescape and unescape do not work with utf-8 bytestrings sval = unicode_str(sval) if EXTRAS: res = xmlescape(unescapeit(sval), EXTRAS) else: res = xmlescape(unescapeit(sval)) return res
def escapeit(sval, EXTRAS=None): if EXTRAS: return xmlescape(unescapeit(sval), EXTRAS) return xmlescape(unescapeit(sval))