标签: python django string python-3.x decode
我正在使用移动运营商API。当我收到波斯语消息时,它会返回像这样的奇怪编码。
062a0633062a
此字符串表示波斯语中的تست。我知道每四个字符都是波斯字符的Unicode表示形式。
تست
如何解码这种编码?
答案 0 :(得分:2)
>>> binascii.unhexlify('062a0633062a').decode('utf-16be') 'تست'