I have a program in which I want to use some Unicode characters, such as µ and subscript p. When I do this,
print u"\xb5"
it works perfectly, but when I do this,
print u"\u209A"
I get this error message:
Traceback (most recent call last):
File "C:/Users/tech/Desktop/Circuit Design Tool/Test 2.py", line 1, in <module>
print u"\u209A"
File "C:\Python27\lib\encodings\cp1252.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u209a' in position 0: character maps to <undefined>
Why is this happening? Are these the correct unicode escapes?