Print Unicode Characters in Python

Print Unicode Characters in Python

Unicode Character is a specified character assigned to a unique character used by the user in human language that gives a unique character of its own. Unicode character has a widespread acceptance in the world of programming.

The specified code or unique character to every human value character is called a code point. Ranging from U+0000 to U+10FFFF the code points are in the form of hexadecimal digits. Each hexadecimal digit has its own Unicode character.

In Python, Unicode characters are represented as a string type. These characters are printed using the print command.

Before giving the hexadecimal value as an input value, the escape sequence \u is used before every hexadecimal value.

Example:

unicode_character = "\u2612\u7687\u00C9\u00C9"
print(unicode_character)

Output:

☒皇ÉÉ

Note that the hexadecimal value stored in the variable is taken as a string.

Related Article - Python Unicode

  • Convert Unicode to ASCII in Python
  • Convert Unicode Characters to ASCII String in Python