How to make nntplib author name human readable?
-
23-08-2019 - |
Question
python NNTPLib is giving me author name such as ,
"=?Utf-8?B?RGVubmlzIEJhc2hhbQ==?= < someone@someforum.com >"
(Quotes for clarity).
How do i encode this text in human readable format?
Solution
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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow