" (quotes for ..." />" (quotes for ...">" (quotes for ...">
Ad

How To Make Nntplib Author Name Human Readable?

- 1 answer

python NNTPLib is giving me author name such as ,

"=?Utf-8?B?RGVubmlzIEJhc2hhbQ==?= < [email protected] >"

(Quotes for clarity).

How do i encode this text in human readable format?

Ad

Answer

The double equals at the end was a dead giveaway. Base 64 uses that for padding strings that do not have an even multiple of 4 bytes.

In python:

print "RGVubmlzIEJhc2hhbQ==".decode('base_64')

In PHP:

<?php echo base64_decode("RGVubmlzIEJhc2hhbQ=="); ?>

Enjoy.

PS... Dennis Basham

Ad
source: stackoverflow.com
Ad