Unicode is generally represented as “\u4EB0\U5317” but this is nearly useless to a user who actually wants to read the real stuff what the text says. So in this article, we will see how to convert Unicode to ASCII Character using the Unihandecode module.
What is Unihandecode?
Unihandecode provide a function ” decode (……) ” that takes Unicode data as input and tries to represent it in ASCII Character. In simple language we can say that it is a transliteration to convert all character in Unicode to ASCII alphabet.
List of decoders
- ‘ja’: Japanese Kanji, Hiragana, and Katakana.
- ‘zh’: Chinese Kanji
- ‘kr’: Korean Character
- ‘vn’: Vietnamese Character
This module does not come built-in with Python. To install this type the below command in the terminal.
pip install unihandecode
Ming Tian De Feng Chui
The first line argument takes the name of the decoder you want to use. Then the decoder takes a string as argument an returns the transliterated string.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.