Vladislav Ladenkov Vladislav Ladenkov - 1 year ago 140
Python Question

Decoding bytes to string in python

i've got a row of bytes:


If i do:


I recieve:


I cant decode it, because i dont know, how it was encoded. At least, we can see, that its not
, because, symbols i expect to see, have a
-similar representation. How can i discover the decoder and decode it?

P.S. i expect to see russian symbols there

Answer Source

I am able to print your string in this way, but the output is all "invalid characters."

>>> string = u'\udcd0\udca0\udcd0\udcbe\udcd1\udc81\udcd0\udcbd\udcd0\udcb5\udcd1\udc84\udcd1\udc82\udcd1\udc8c'
>>> print string

According to Charbase.com, your first character (u'\udcd0') is invalid character. So maybe the output is correct.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download