Re: sorting german characters äöü...

2013-10-30 Thread Christian Heimes
Am 30.10.2013 19:38, schrieb Ulrich Goebel: > Hello, > > for a SQLite database I would like to prepare a collating function in > python. It has to compare two (unicode-)strings s, t and should return > -1 if st. > > The strings are german names/words, and what I would like is to have a > case-ins

Re: sorting german characters äöü... solved

2013-10-30 Thread Ulrich Goebel
Hi, Am 30.10.2013 19:48, schrieb Skip Montanaro: Perhaps this? http://stackoverflow.com/questions/816285/where-is-pythons-best-ascii-for-this-unicode-database There I found the module unidecode (http://pypi.python.org/pypi/Unidecode), and I found it very helpful. Thanks a lot! So my function

Re: sorting german characters äöü...

2013-10-30 Thread Skip Montanaro
> That works, but my be there is a more intelligent way? Especially there > could be much more r.replace to handle all the accents as ^ ° ´ ` and so on. Perhaps this? http://stackoverflow.com/questions/816285/where-is-pythons-best-ascii-for-this-unicode-database There is also a rather long-ish r

sorting german characters äöü...

2013-10-30 Thread Ulrich Goebel
Hello, for a SQLite database I would like to prepare a collating function in python. It has to compare two (unicode-)strings s, t and should return -1 if st. The strings are german names/words, and what I would like is to have a case-insensitive ordering, which treates ä as a ö as ö