Printing UTF-8 characters in code


I know how to use UTF-8 character in Markrdown cells, but I don’t understand the syntax to print the same in code. For example, this entry in a markdown cell gives me the Euro currency symbol: ₡

I tried ti eke out the syntax from here, using \u in the following code print("\u8353") but that prints a different character. I suspect that this syntax is for hex, not the decimal code for the Euro symbol.

In addition, I don’t seem to be able to concatenate strings with \u. What I am trying to do is the following for the currency symbols in the range 8352-8399 found here

For i in range (8352,8400):
print (i #the decimal code itself, some spaces, the actual symbol)

Apart of the pseudo-code, I am lost…

Thank you for your suggestions.

Python has a chr function that will

Return the string representing a character whose Unicode code point is the integer i .


Thanks a lot manics. I had not come across that before. Much appreciated

1 Like