Windows NT shell + extended characters. Bug or what?

Martin v. Loewis martin at v.loewis.de
Fri Mar 15 19:06:45 EST 2002


"Jason Orendorff" <jason at jorendorff.com> writes:

> Alas, the PC console uses a different character set called CP437,
> which is not Latin-1 compatible.  In CP437, the pound sign
> is 156 and the yen sign is 157.

This isn't really true. The console on Windows (I believe both Win9x,
and NTx) use what MS calls the "OEM" charset. Which code page that is
depends on the Windows installation. In the US English installation,
it is indeed CP437. In the European installations, it is CP852 most of
the time.

>         [in Win2K console]
>         >>> ord(u'£')
>         156    # uhhh, no
>         >>> ord(u'\N{POUND SIGN}')
>         163    # correct answer
> 
>       I think it's fair to say this is a deficiency in current
>       versions of Python.  I believe it will be fixed

This is rather unlikely, I doubt the interactive interpreter will ever
be able to properly identify the encoding of the console window. More
likely, this line will give an error, since no encoding has been
declared.

Regards,
Martin



More information about the Python-list mailing list