[Python-Dev] UTF-16 code point comparison

Fredrik Lundh Fredrik Lundh" <effbot@telia.com
Thu, 27 Jul 2000 09:44:30 +0200


finn bock wrote:
> Java (and JPython) compares the 16-bit characters numericly which =
result in:
>=20
>   JPython 1.1+08 on java1.3.0 (JIT: null)
>   Copyright (C) 1997-1999 Corporation for National Research =
Initiatives
>   >>> print u'\ue000' < u'\ud800'
>   0
>   >>> print ord(u'\ue000') < ord(u'\ud800')
>   0
>   >>>
>=20
> I don't think I can come up with a solution that allow JPython to =
emulate
> CPython on this type of comparison.

since we don't really support surrogates (or anything else
related to 32-bit unicode) anywhere else, I'd rather change
CPython to emulate JPython here.

(just #ifdef out the neat stuff, and don't switch it on again
before we've sorted all other 32-bit unicode issues...)

</F>