[Python-Dev] adding Py{String|Unicode}_{Lower|Upper} and fixing CreateProcess in _subprocess.pyd and PyWin32

"Martin v. Löwis" martin at v.loewis.de
Thu Oct 28 07:44:15 CEST 2004

Tim Peters wrote:
> Well, the docs are lying about Win95 (it doesn't sort envar blocks). 
> On NT+, the sort must also be in "Unicode order, without regard to
> locale" -- WTF that means:

It means that the sorting uses ordinal character numbers, not the order
characters have in the German alphabet.

The interesting question then is what case-insensitive sorting by
ordinal number means: you convert either to lower case, or to upper
case (again, independent of locale), and sort by ordinal number
after that conversion.

Then the question is: lower case or upper case? as the order depends
on that choice. I believe Windows always uses upper case for this
kind of thing. At least NTFS sorts by upper case, by means of the
$UpCase file.

> That claims NT+ uses RTLCompareUnicodeString to search for envars (and
> that function has a case-insensitive option).

That sounds reasonable, and it should be used, then, because it will be
impossible to emulate that function with Python library functions (if
for no other reason that RTLCompareUnicodeString probably assumes 
Unicode 2.2, whereas Python only has the Unicode 3.2 database).


More information about the Python-Dev mailing list