0

I have some texts like bellow:

%d8%b3%d9%88%d8%a6%ab%8c%da%86

I have tried to change it Arabic as bellow:

import binascii    
print(binascii.unhexlify(''.join('%d8%b3%d9%88%d8%a6%ab%8c%da%86'.split('%'))).decode('ISO-8859-1').encode('utf8').decode('mac-arabic'))

But I was not successful and the result is :

أ»آ٣أôآàأ»آ&آ+آ«أöآÜ
Mahdi
  • 967
  • 4
  • 18
  • 34
  • 1
    Does this answer your question? [How can I encode and decode percent-encoded (URL encoded) strings in Python?](https://stackoverflow.com/questions/33143504/how-can-i-encode-and-decode-percent-encoded-url-encoded-strings-in-python) – Mateen Ulhaq Jan 12 '20 at 06:38

1 Answers1

1

The correct code is:

import binascii    
print(binascii.unhexlify(''.join('%d8%b3%d9%88%d8%a6%db%8c%da%86'.split('%'))).decode('utf-8'))
Mahdi
  • 967
  • 4
  • 18
  • 34