FAQ
I'm working on a script that grabs messages from a Usenet server and does
some work with them. All works nicely except for a few issues with the
data I retrieve.

For example, in one newsgroup I find occasional lines containing bits
like:
"Re: Mlle. =?ISO-8859-1?Q?Anaïs_introdooses_her_ownself.?="

Is this some sort of bizarre MIME encoding? Looking at the data I can see
how what the "ï" and "." mean, but that stuff after the first = has
me confused.

And more to the point, is there a python module to handle this?

Search Discussions

  • Dan M at Oct 28, 2010 at 8:12 pm
    On Thu, 28 Oct 2010 15:05:56 -0500, Dan M wrote:

    Ok, I didn't research enough before I posted this. I see now that this
    *is* indeed a MIME message, and the '?Q' bit says that the next piece is
    quoted-printable, and that the encoding is defined in RFC2047.

    So the question the becomes, do we have a library for reading info like
    this?
  • Superpollo at Oct 28, 2010 at 8:19 pm

    Dan M ha scritto:
    On Thu, 28 Oct 2010 15:05:56 -0500, Dan M wrote:

    Ok, I didn't research enough before I posted this. I see now that this
    *is* indeed a MIME message, and the '?Q' bit says that the next piece is
    quoted-printable, and that the encoding is defined in RFC2047.

    So the question the becomes, do we have a library for reading info like
    this?
    maybe http://docs.python.org/library/email ?

    bye
  • Anssi Saari at Oct 28, 2010 at 8:36 pm

    Dan M <dan at catfolks.net> writes:

    On Thu, 28 Oct 2010 15:05:56 -0500, Dan M wrote:

    Ok, I didn't research enough before I posted this. I see now that this
    *is* indeed a MIME message, and the '?Q' bit says that the next piece is
    quoted-printable, and that the encoding is defined in RFC2047.

    So the question the becomes, do we have a library for reading info like
    this?
    The quopri module handles quoted-printable. I've used it to demangle
    mail headers. I had a regexp from a perl script available to split
    headers, so I just fed the quoted-printable part to
    quopri.decodestring, even though quopri.decode should be able to
    handle a header directly.

    Headers can sometime be encoded in base64 as well, at least in emails.
    I don't think it's common in Usenet though. But that can be decoded by
    the base64 module.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 28, '10 at 8:05p
activeOct 28, '10 at 8:36p
posts4
users3
websitepython.org

3 users in discussion

Dan M: 2 posts Superpollo: 1 post Anssi Saari: 1 post

People

Translate

site design / logo © 2022 Grokbase