[issue11833] ord() doesn't show complete UNICODE

Ezio Melotti report at bugs.python.org
Tue Apr 12 07:36:01 CEST 2011


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

The problem is not with ord() but with the stdin encoding used by the windows terminal.
If you write a non-ASCII character (e.g. '¥') in the windows terminal with Python 2 without using the u'' prefix, it will be encoded with the encoding specified by sys.stdin.encoding.  If this encoding is a single-byte encoding (e.g. cp850) the result for non-ASCII character might be misleading.
If you want the correct result use ord(u'—') and ord(u'¥').

----------
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed
type:  -> behavior

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11833>
_______________________________________


More information about the Python-bugs-list mailing list