String Encoding / Decoding

'=? KOI8-R? IN? W1JFUS0wMDI1NDEtNDc5NzddIO / h7yAi89TSz8rGwdLGz9IiIDs =? = \ R \ n \ m =? KOI8-R? B Ry43MjkgKDEwKQ ==? = '

How can I convert this to something readable? Thanks!

+3
source share
2 answers
>>> email.header.decode_header('=?KOI8-R?B?W1JFUS0wMDI1NDEtNDc5NzddIO/h7yAi89TSz8rGwdLGz9IiIDs=?=\r\n\t=?KOI8-R?B?Ry43MjkgKDEwKQ==?=') [('[REQ-002541-47977] \xef\xe1\xef "\xf3\xd4\xd2\xcf\xca\xc6\xc1\xd2\xc6\xcf\xd2" ;G.729 (10)', 'koi8-r')] >>> print '[REQ-002541-47977] \xef\xe1\xef "\xf3\xd4\xd2\xcf\xca\xc6\xc1\xd2\xc6\xcf\xd2" ;G.729 (10)'.decode('koi8-r') [REQ-002541-47977]  "" ;G.729 (10) 
+11
source

This is the encoding of the coded word as specified in RFC 2047 .

The email package must deal with this format.

+3
source

Source: https://habr.com/ru/post/1343173/


All Articles