NNTPlib encoding issue

Discussion in 'Python' started by mohit_ranka, Feb 13, 2009.

  1. mohit_ranka

    mohit_ranka Guest

    I am getting unknown encoding like, "=?Utf-8?B?QWRyaWFu?=
    <>" (quotes for clarity) for name of
    the author from nntplib module. which seems like an encoding issue
    with NNTPLib module.

    What should i do to get author name information in human readable
    format.

    Thanks and regards,
    Mohit Ranka
     
    mohit_ranka, Feb 13, 2009
    #1
    1. Advertising

  2. mohit_ranka

    MRAB Guest

    mohit_ranka wrote:
    > I am getting unknown encoding like, "=?Utf-8?B?QWRyaWFu?=
    > <>" (quotes for clarity) for name of
    > the author from nntplib module. which seems like an encoding issue
    > with NNTPLib module.
    >
    > What should i do to get author name information in human readable
    > format.
    >

    The original text was encoded in UTF-8 and then into base-64:

    =?Utf-8?B?QWRyaWFu?=
    ^^^^^ UTF-8

    =?Utf-8?B?QWRyaWFu?=
    ^ Base-64

    So that's:

    >>> "QWRyaWFu".decode("base-64").decode("Utf-8")

    u'Adrian'
     
    MRAB, Feb 13, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rakesh

    nntplib: abstraction of threads

    Rakesh, Jan 16, 2005, in forum: Python
    Replies:
    4
    Views:
    303
  2. Replies:
    2
    Views:
    315
  3. Hanman

    get "in reply to" with nntplib

    Hanman, Apr 24, 2006, in forum: Python
    Replies:
    0
    Views:
    274
    Hanman
    Apr 24, 2006
  4. Helmut Jarausch

    NNTPlib::xover problem

    Helmut Jarausch, Aug 7, 2006, in forum: Python
    Replies:
    2
    Views:
    355
    Helmut Jarausch
    Aug 7, 2006
  5. Laurent Duchesne

    nntplib encoding problem

    Laurent Duchesne, Feb 28, 2011, in forum: Python
    Replies:
    0
    Views:
    201
    Laurent Duchesne
    Feb 28, 2011
Loading...

Share This Page