# Collection of code snippets by Arne Vajhøj 
# (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
from email.header import decode_header

def test(s):
    print(s)
    s2 = decode_header(s)
    print(s2[0][0])
    print(s2[1][0].strip())

test('=?iso-8859-9?b?T/B1eg==?= <oguz.ismail.uysal@gmail.com>')
test('=?utf-8?Q?=EB=AF=B8?= <taeyeon10006@gmail.com>')
test('=?GBK?B?0Pu66A==?= <xuan.alan@163.com>')
test('=?UTF-8?B?zp3Or866zr/PgiDOks6tz4HOs86/z4I=?= <vergos.nikolas@gmail.com>')
