[Python-nl] sorting slovak utf
Stano Paska
paska at kios.sk
Mon Dec 8 08:07:07 EST 2003
I forgot append a file.
Stano Paska wrote:
> Hi,
>
> I have one problem.
> In file aaa.txt I have slovak letters in utf-8.
>
> zcaron
> scaron
> aacute
> ocircumflex
> tcaron
> yacute
> ccaron
> eacute
> lcaron
> iacute
> dcaron
> uacute
> adiaeresis
> oacute
> lacute
> ncaron
> racute
>
> with this script (output is redirected to file bbb.txt):
>
> import fileinput
> riadky = []
> a = fileinput.input("aaa.txt")
> for i in a:
> riadky.append(i.strip())
> a.close()
> riadky.sort()
> for i in riadky:
> print i
>
> I have this result:
>
> aacute
> adiaeresis
> eacute
> iacute
> oacute
> ocircumflex
> uacute
> yacute
> ccaron
> dcaron
> lacute
> lcaron
> ncaron
> racute
> scaron
> tcaron
> zcaron
>
> and corrent result would be:
>
> aacute
> adiaeresis
> ccaron
> dcaron
> eacute
> iacute
> lacute
> lcaron
> ncaron
> oacute
> ocircumflex
> racute
> scaron
> tcaron
> uacute
> yacute
> zcaron
>
> I have set utf-8 in sitecustomize.py
>
> I tried:
> import locale
> locale.setlocale(locale.LC_CTYPE, 'sk_SK.utf-8')
> and
> locale.setlocale(locale.LC_CTYPE, ('sk_SK', 'utf-8'))
> but i got "unsupported locale" error
>
> What I must do to get correct sorting result?
>
> Stano.
>
> P.S. lower, upper works correct
>
>
>
> _______________________________________________
> Python-nl mailing list
> Python-nl at python.org
> http://mail.python.org/mailman/listinfo/python-nl
>
-------------- next part --------------
ž
Å¡
á
ô
Å¥
ý
Ä
é
ľ
Ã
Ä
ú
ä
ó
ĺ
Å
Å
More information about the Python-nl
mailing list