[XML-SIG] [OT] locale.py doesn't work? (fwd)

Roman Suzi rnd@onego.ru
Tue, 6 Feb 2001 08:23:26 +0300 (MSK)


I am sorry for offtopic, but I can't contact Martin at
martin@mira.cs.tu-berlin.de for a week already.
(connection refused)

Roman.
---------- Forwarded message ----------
Date: Tue, 30 Jan 2001 15:46:02 +0300 (MSK)
From: Roman Suzi <rnd@onego.ru>
To: Martin v. Loewis <martin@mira.cs.tu-berlin.de>
Subject: locale.py doesn't work?

Hello, Martin!

I am trying to use ru_RU.koi8-r locale
(collation, uppercase, etc) but it doesn't work
for unknown reason.

Here is a code:

> cat ./try_locale.py
#!/usr/bin/env python

import locale

import os
# os.environ["LC_ALL"] =3D "ru_RU.CP1251"

# print locale.getdefaultlocale()

locale.setlocale(locale.LC_ALL,['ru_RU','koi8-r'])
#locale.setlocale(locale.LC_ALL,['ru_RU','KOI8-R'])

print locale.getlocale()

print locale.string.uppercase
print locale.string.lowercase

# End of try_locale.py

> ./try_locale.py
['ru_RU', 'ISO8859-5']
ABCDEFGHIJKLMNOPQRSTUVWXYZ=A1=A2=A3=A4=A5=A6=A7=A8=A9=AA=AB=AC=AE=AF=B0=B1=
=B2=B3=B4=B5=B6=B7=B8=A0=BA=BB=BC=BD=BE=BF=C0=C1=C2=C3=C4=C5=C6=C7=C8=C9=CA=
=CB=CC=CD=CE=CF
abcdefghijklmnopqrstuvwxyz=D0=D1=D2=D3=D4=D5=D6=D7=D8=D9=DA=DB=DC=DD=DE=DF=
=E0=E1=E2=E3=E4=E5=E6=E7=E8=E9=EA=EB=EC=ED=EE=EF=F1=F2=F3=F4=F5=F6=F7=F8=F9=
=FA=FB=FC=FE=FF

- which is wrong, because koi8-r uppercase letters are different.
It is not even ISO8859-5 (I tried with recode:

> ./try_locale.py | recode ISO8859-5..koi8-r
['ru_RU', 'ISO8859-5']
ABCDEFGHIJKLMNOPQRSTUVWXYZ=B3recode: Invalid input in step
`ISO-8859-5..KOI8-R'

- and this is strange.

Am I missing something important?
Or is it a bug in Python 2.0?
(All this in BlackCat Linux 6.2 ~=3D RH 6.2)

(You are the author of the article "Internationalizing Python"
so probably you could answer this question.)

Sincerely yours, Roman Suzi
--=20
Vote for my design: http://silvermouse.onego.ru/gray.php3?id=3D0018
_/ Russia _/ Karelia _/ Petrozavodsk _/ rnd@onego.ru _/
_/ Tuesday, January 30, 2001 _/ Powered by Linux RedHat 6.2 _/
_/ "Give instruction to a wise man and he will be yet wiser." _/