Pablo Fernandez
Pablo Fernandez

Reputation: 105210

Printing a utf-8 character to console

I'm trying to print a utf-8 character to console.

Isn't this supposed to work?

enter image description here

Upvotes: 2

Views: 87

Answers (1)

Sohaib Farooqi
Sohaib Farooqi

Reputation: 5666

The former statement prints the value as bytes while the latter statement uses a string value. Changing it to bytes will give you the required output.

>>> b'\xc3\x91'.decode()
>>> 'Ñ'

Upvotes: 1

Related Questions