Case-insensitive string equality
Chris Angelico
rosuav at gmail.com
Sun Sep 3 08:07:23 EDT 2017
More information about the Python-list mailing list
Sun Sep 3 08:07:23 EDT 2017
- Previous message (by thread): Case-insensitive string equality
- Next message (by thread): Case-insensitive string equality
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Sun, Sep 3, 2017 at 5:17 PM, Stephan Houben <stephanh42 at gmail.com.invalid> wrote: > Generally speaking, the more you learn about case normalization, > the more attractive case sensitivity looks ;-) Absolutely agreed. My general recommendation is to have two vastly different concepts: "equality matching" and "searching". Equality is case sensitive and strict; NFC/NFD normalization is about all you can do. Searching, on the other hand, can be case insensitive, do NFKC/NFKD normalization, and can even (in many contexts) strip off diacritical marks altogether, allowing people to search for "resume" and find "résumé", or to search for "muller" and find "Müller". There can be a whole swathe of other transformations done in search normalization too (collapse whitespace, fold punctuation into a few types, etc), though of course you need to be aware of context. But IMO it's far safer to NOT define things in terms of "equality". ChrisA
- Previous message (by thread): Case-insensitive string equality
- Next message (by thread): Case-insensitive string equality
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list