Decoding bytes to string in python -
i've got row of bytes: '\udcd0\udca0\udcd0\udcbe\udcd1\udc81\udcd0\udcbd\udcd0\udcb5\udcd1\udc84\udcd1\udc82\udcd1\udc8c'
if do:
b'\udcd0\udca0\udcd0\udcbe\udcd1'.decode("utf8"),
i recieve:
'\\udcd0\\udca0\\udcd0\\udcbe\\udcd1'
i cant decode it, because dont know, how encoded. @ least, can see, not utf-8
, because, symbols expect see, have \x23
-similar representation. how can discover decoder , decode it?
p.s. expect see russian symbols there
i able print string in way, output "invalid characters."
>>> string = u'\udcd0\udca0\udcd0\udcbe\udcd1\udc81\udcd0\udcbd\udcd0\udcb5\udcd1\udc84\udcd1\udc82\udcd1\udc8c' >>> print string ����������������
according charbase.com, first character (u'\udcd0') invalid character. maybe output correct.
Comments
Post a Comment