Could someone please explain why python prints unicode characters in this instance

Posted by mike on Stack Overflow See other posts from Stack Overflow or by mike
Published on 2010-04-08T00:03:08Z Indexed on 2010/04/08 0:13 UTC
Read the original article Hit count: 626

Filed under:
|
|
|

From the Python 2.6 shell:

>>> import sys
>>> print sys.getdefaultencoding()
ascii
>>> print u'\xe9'
é
>>> 

I expected to have either some gibberish or an Error after the print statement, since the "é" character isn't part of ASCII and I haven't specified an encoding. I guess I don't understand what ASCII being the default encoding means.

© Stack Overflow or respective owner

Related posts about python

Related posts about unicode