One of my string variables contains unicode code \u0631\u064e\u062c\u0627.
I want to convert it to a string and see what characters were encoded by it.
Is it possible and how can I do it in python?
Decode using unicode_escape encoding:
In Python 2.x:
>>> text = r'\u0631\u064e\u062c\u0627'
>>> print(text)
\u0631\u064e\u062c\u0627
>>> print(text.decode('unicode-escape'))
رَجا
In Python 3.x:
>>> text = r'\u0631\u064e\u062c\u0627'
>>> print(text.encode().decode('unicode-escape'))
رَجا