Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > de.comp.lang.python > #4929
| 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 <usenet@waldi.eu.org> |
| Newsgroups | de.comp.lang.python |
| Subject | Re: 'z' < 'ä' |
| Date | Mon, 2 Oct 2017 14:24:34 -0000 (UTC) |
| Organization | A thinking site |
| Message-ID | <slrnot4j12.au4.usenet@mobilewave.waldi.eu.org> (permalink) |
| References | <z_kleiner_ae-20171002144954@ram.dialup.fu-berlin.de> |
| 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 |
Show key headers only | View raw
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
Back to de.comp.lang.python | Previous | Next — Next in thread | Find similar
Re: 'z' < 'ä' Bastian Blank <usenet@waldi.eu.org> - 2017-10-02 14:24 +0000 Re: [Python-de] 'z' < 'ä' Stefan Behnel <python-de@behnel.de> - 2017-10-03 18:15 +0200
csiph-web