]> granicus.if.org Git - python/commit
Better support for RFC 1521 quoted-printable specification, along with
authorBarry Warsaw <barry@python.org>
Tue, 19 Jun 2001 19:07:46 +0000 (19:07 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 19 Jun 2001 19:07:46 +0000 (19:07 +0000)
commit9b630a50200e44e16acfe3dee4052b3d0b0677e4
tree9b9d9a753241e22f9bf6ff2844e9e06075fbd964
parente275c42c38f7a83275de027b200b39460b3ec7b7
Better support for RFC 1521 quoted-printable specification, along with
addition of interface for consistency with base64 module.  Namely,

encodestring(), decodestring(): New functions which accept a string
object and return a string object.  They just wrap the string in
StringIOs and pass them to the encode() and decode() methods
respectively.  encodestring() accepts a default argument of quotetabs,
defaulting to zero, which is passed on straight through to encode().

encode(): Fix the bug where an extra newline would always be added to
the output, which prevented an idempotent roundtrip through
encode->decode.  Now, if the source string doesn't end in a newline,
then the result string won't end in a newline.

Also, extend the quotetabs argument semantics to include quoting
embedded strings, which is also optional according to the RFC.

test() -> main()

"from quopri import *" also imports encodestring() and decodestring().
Lib/quopri.py