Hi !

Have the python standard mod. lib. a html/xml encoder functions/procedures ?

like this:

def ToSafeHTM(Text):
    s=ToHuStrSafe(Text)
    l=[]
    for c in s:
        b=ord(c)
        if c=="\n":
            c="<br>"
        else:
            if b<32 or b>127 or c in ['<','>','"',';','&','@','%','#']:
                c="&#%03d;"%b
        l.append(c)
    s="".join(l)
    return s

Thanx for help:
    dd
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to