Path: csiph.com!weretis.net!feeder4.news.weretis.net!news.unit0.net!news.uni-stuttgart.de!thinkmo.de!.POSTED.shell.thinkmo.de!not-for-mail From: Bastian Blank Newsgroups: de.comp.lang.python Subject: Re: 'z' < =?UTF-8?Q?=27=C3=A4=27?= Date: Mon, 2 Oct 2017 14:24:34 -0000 (UTC) Organization: A thinking site Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Mon, 2 Oct 2017 14:24:34 -0000 (UTC) Injection-Info: news.thinkmo.de; posting-host="shell.thinkmo.de:2a01:4f8:221:1902:0:22:0:1"; logging-data="23139"; mail-complaints-to="abuse@thinkmo.de" User-Agent: slrn/1.0.3 (Linux) Xref: csiph.com de.comp.lang.python:4929 Stefan Ram wrote: > In Python scheint > > 'z' < 'ä' > > wahr zu sein. Ist dies wie > > ord( 'z' )< ord( 'ä' ) > > zu verstehen? > > Gibt es eine Möglichkeit, beispielsweise zum Sortieren von > Texten, Python zu erklären, daß man »ä« wie »ae« einordnen > möchte (oder direkt davor oder dahinter)? Sicher: | >>> import locale | >>> locale.setlocale(locale.LC_ALL, '') | 'LC_CTYPE=de_DE.UTF-8;LC_NUMERIC=de_DE.UTF-8;LC_TIME=de_DE.UTF-8;LC_COLLATE=de_DE.UTF-8;LC_MONETARY=de_DE.UTF-8;LC_MESSAGES=en_GB.UTF-8;LC_PAPER=de_DE.UTF-8;LC_NAME=de_DE.UTF-8;LC_ADDRESS=de_DE.UTF-8;LC_TELEPHONE=de_DE.UTF-8;LC_MEASUREMENT=de_DE.UTF-8;LC_IDENTIFICATION=de_DE.UTF-8' | >>> locale.strcoll('b', 'ä') | 1 | >>> locale.strcoll('a', 'ä') | -8 Bastian