3

'=?KOI8-R?B?W1JFUS0wMDI1NDEtNDc5NzddIO/h7yAi89TSz8rGwdLGz9IiIDs=?=\r\n\t=?KOI8-R?B?Ry43MjkgKDEwKQ==?='

How can I convert this into something readable ? Thanks !

  • 1
    Related: [email header decoding UTF-8](http://stackoverflow.com/questions/7331351/python-email-header-decoding-utf-8) – Ivan Chau Sep 13 '15 at 07:29

2 Answers2

12
>>> 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)
Ignacio Vazquez-Abrams
  • 776,304
  • 153
  • 1,341
  • 1,358
  • http://translate.google.com/translate_t?hl=&ie=UTF-8&text=%D0%A1%D1%82%D1%80%D0%BE%D0%B9%D1%84%D0%B0%D1%80%D1%84%D0%BE%D1%80&sl=ru&tl=en# ;) – etarion Feb 04 '11 at 09:23
  • 1
    It's a compound of the Russian words for 'build' and 'porcelain'. Presumably the name of a company that makes bathroom fittings. – Michael Dunn Feb 04 '11 at 09:26
3

This is encoded-word encoding as specified in RFC 2047.

The email package should be able to deal with this format.

Community
  • 1
  • 1
Joachim Sauer
  • 302,674
  • 57
  • 556
  • 614