Windows NT shell + extended characters. Bug or what?

Noel Smith nsbase at yahoo.co.uk
Fri Mar 15 06:19:20 EST 2002


I've been recently using the Python shell on Linux as a handy way to
get character numbers from various extended LATIN-1 characters.

i.e. For UK pound and Yen currency signs:

>>> print ord('£')
163
>>> print ord('¥')
165

Which are the correct values.

However I've recently installed python 7.2 on Windows NT4 and found it
gives the following results when using the command line shell:

>>> print ord('£')
156
>>> print ord('¥')
157

Which is clearly wrong although strangely enough when I type the same
thing into IDLE on Windows NT, it produces the correct results.

Is this a bug or is there some windows character mapping going on
behind the scenes which I've missed out? Is there any configuration
that I've missed out?

Any help would be really appreciated.

Noel Smith



More information about the Python-list mailing list