Thread View: pl.comp.lang.python
4 messages
4 total messages
Started by noname
Mon, 31 Mar 2014 16:12
[3.3.3linux] 'ć' < 'g' (False)
Author: noname
Date: Mon, 31 Mar 2014 16:12
Date: Mon, 31 Mar 2014 16:12
22 lines
1248 bytes
1248 bytes
locale.getlocale()
('pl_PL','UTF-8')
'c' < 'g'
True
'd' < 'g'
True
'ć' < 'g'
False
locale.setlocale(locale.LC_COLLATE,'pl_PL.UTF-8')
('pl_PL.UTF-8')
'ć' < 'g'
False
^D
#export PYTHONIOENCODING='utf_8'
#python
'ć' < 'g'
False
To chyba nie ma rady? - trzeba sobie coś sensownego napisać?
Re: [3.3.3linux] 'ć' < 'g' (False)
Author: marrgol
Date: Mon, 31 Mar 2014 22:15
Date: Mon, 31 Mar 2014 22:15
30 lines
1385 bytes
1385 bytes
On 2014-03-31 18:12, noname wrote:
>
> locale.getlocale()
> ('pl_PL','UTF-8')
> 'c' < 'g'
> True
> 'd' < 'g'
> True
> 'ć' < 'g'
> False
>
> locale.setlocale(locale.LC_COLLATE,'pl_PL.UTF-8')
> ('pl_PL.UTF-8')
> 'ć' < 'g'
> False
>
> To chyba nie ma rady? - trzeba sobie coś sensownego napisać?
locale.setlocale(locale.LC_COLLATE,'pl_PL.UTF-8')
'pl_PL.UTF-8'
locale.strcoll('ć','c')
1
locale.strcoll('ć','ć')
0
locale.strcoll('ć','d')
-1
--
mrg
Re: [3.3.3linux] 'ć' < 'g' (False)
Author: noname
Date: Tue, 01 Apr 2014 07:52
Date: Tue, 01 Apr 2014 07:52
21 lines
1485 bytes
1485 bytes
marrgol wrote:
>
> locale.setlocale(locale.LC_COLLATE,'pl_PL.UTF-8')
> 'pl_PL.UTF-8'
> locale.strcoll('ć','c')
> 1
> locale.strcoll('ć','ć')
> 0
> locale.strcoll('ć','d')
> -1
>
>
podziękował,
szkoda że nie zajrzałem do locale lepiej (i napisałem niepotrzebnie f. w C),
chodziło ostatecznie o coś w ten deseń (szukanie rekordu w miarę pisania)
locale.strcoll('alać','alad')
ciekwawie jest dla:
strcoll('abc','ab')
99
Re: [3.3.3linux] 'ć' < 'g' (False)
Author: noname
Date: Tue, 01 Apr 2014 12:00
Date: Tue, 01 Apr 2014 12:00
8 lines
1384 bytes
1384 bytes
noname wrote: > (i napisałem niepotrzebnie f. w C), Przepraszam, że tak PP, pospieszyłem się z tym "niepotrzebnie". Zostaję przy swoim kawałku kodu, działa w zakresie mi potrzebnym. pozwolę sobie ku pamięci przytoczyć linka: http://stackoverflow.com/questions/3412933/python-not-sorting-unicode- properly-strcoll-doesnt-help
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads