Re: Problem with lower() for unicode strings in russian

2008-10-06 Thread konstantin
On Oct 6, 8:39 am, Alexey Moskvin [EMAIL PROTECTED] wrote: Martin, thanks for fast reply, now anything is ok! On Oct 6, 1:30 am, Martin v. Löwis [EMAIL PROTECTED] wrote: I have a set of strings (all letters are capitalized) at utf-8, That's the problem. If these are really utf-8 encoded

Problem with lower() for unicode strings in russian

2008-10-05 Thread Alexey Moskvin
Hi! I have a set of strings (all letters are capitalized) at utf-8, russian language. I need to lower it, but my_string.lower(). Doesn't work. See sample script: # -*- coding: utf-8 -*- [skip] s1 = self.title s2 = self.title.lower() print s1 == s2 returns true. I have no problems with lower() for

Re: Problem with lower() for unicode strings in russian

2008-10-05 Thread Diez B. Roggisch
Alexey Moskvin schrieb: Hi! I have a set of strings (all letters are capitalized) at utf-8, russian language. I need to lower it, but my_string.lower(). Doesn't work. See sample script: # -*- coding: utf-8 -*- [skip] s1 = self.title s2 = self.title.lower() print s1 == s2 returns true. I have no

Re: Problem with lower() for unicode strings in russian

2008-10-05 Thread Martin v. Löwis
I have a set of strings (all letters are capitalized) at utf-8, That's the problem. If these are really utf-8 encoded byte strings, then .lower likely won't work. It uses the C library's tolower API, which works on a byte level, i.e. can't work for multi-byte encodings. What you need to do is

Re: Problem with lower() for unicode strings in russian

2008-10-05 Thread Alexey Moskvin
Martin, thanks for fast reply, now anything is ok! On Oct 6, 1:30 am, Martin v. Löwis [EMAIL PROTECTED] wrote: I have a set of strings (all letters are capitalized) at utf-8, That's the problem. If these are really utf-8 encoded byte strings, then .lower likely won't work. It uses the C