[Python-Dev] Bug #112265: Tkinter seems to treat everything as Latin 1

Tim Peters tim_one@email.msn.com
Sat, 26 Aug 2000 17:14:37 -0400


>>     UnicodeError: ASCII decoding error: ordinal not in range(128)

> btw, what the heck is an "ordinal"?

It's a technical term <wink>.  But it's used consistently in Python, e.g.,
that's where the name of the builtin ord function comes from!

>>> print ord.__doc__
ord(c) -> integer

Return the integer ordinal of a one character string.
>>>

> ...
> how about an "ordinal number"?  that is, "a number designating the
> place (as first, second, or third) occupied by an item in an
> ordered sequence".

Exactly.  Each character has an arbitrary but fixed position in an arbitrary
but ordered sequence of all characters.  This isn't hard.

> wouldn't "character" be easier to grok for mere mortals?

Doubt it -- they're already confused about the need to distinguish between a
character and its encoding, and the *character* is most certainly not "in"
or "out" of any range of integers.

> ...and isn't "range(128)" overly cute?

Yes.

> UnicodeError: ASCII decoding error: character not in range 0-127

As above, it makes no sense.  How about compromising on

> UnicodeError: ASCII decoding error: ord(character) > 127

?