In process of coding email bot which reads and saves all attachments I have encountered with problem of reading attachments' filenames. They come in format of encoded2 string and are often in Russian( There are no problems with English names). How can I decode this format into Russian text, and what is this format? All my attempts were fruitless. If someone knows an explicit article please give a link. Would be greatful.
encoded = 'YmFzZTY0IGVuY29kZWQgc3RyaW5n'
encoded2 = '0J/QvtC00LPQvtGC0L7QstC60LAg0Log0JzQptCa0J4gMTDQuDIg0LHQu9C+0Log0L/RgNC+0LPRgNCw0LzQvNC40YDQvtCy0LDQvdC40Y8ucGRm'
data = base64.b64decode(encoded)
data2 = base64.b64decode(encoded2)
print(data2)#prints \xd0 .....
print(data) #prints b"base64 encoded string"
message = data2.decode("cp1251")
print(message)# outputs strange symbols РџРѕРґРіРѕ .....```