The task is to convert Де
to Де
.
Does Python 3 has builtin function or I need to parse this string and then use builtin chr
method to convert each number to string?
Asked
Active
Viewed 235 times
2

Artem Rys
- 149
- 9
2 Answers
2
You can use the html.unescape
function:
import html
text = 'Де'
result = html.unescape(text)

Willem Van Onsem
- 443,496
- 30
- 428
- 555
-
Thank you very much. It works as I expected. – Artem Rys Mar 02 '17 at 13:21
-
interesting usage of bold there, it must be a pain to type, though :-) – Dimitris Fasarakis Hilliard Mar 02 '17 at 13:22
-
1@JimFasarakis-Hilliard: well after some 100 posts you can do it automatically. Furthermore you can program it into the Advantage Kinesis keyboard :) – Willem Van Onsem Mar 02 '17 at 13:24
2
In python 3.4 and above, you can use html.unescape
:
>>> import html
>>> print(html.unescape('Де'));
Де

Mureinik
- 297,002
- 52
- 306
- 350