--- quopri.py.old Thu Oct 5 15:43:00 2000 +++ quopri.py Fri Feb 9 14:28:44 2001 @@ -8,6 +8,22 @@ MAXLINESIZE = 76 HEX = '0123456789ABCDEF' +def encodestring(s): + """Encode a string.""" + import StringIO + f = StringIO.StringIO(s) + g = StringIO.StringIO() + encode(f, g) + return g.getvalue() + +def decodestring(s): + """Decode a string.""" + import StringIO + f = StringIO.StringIO(s) + g = StringIO.StringIO() + decode(f, g) + return g.getvalue() + def needsquoting(c, quotetabs): """Decide whether a particular character needs to be quoted.