# Umlautsortierung sqlite

**URL:** <https://www.ruby-forum.com/t/umlautsortierung-sqlite/160762>\
**Category:** DE\
**Created:** [February 19, 2009, 1:37pm UTC](https://www.ruby-forum.com/t/umlautsortierung-sqlite/160762 "2009-02-19T13:37:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [February 19, 2009, 1:37pm UTC](https://www.ruby-forum.com/t/umlautsortierung-sqlite/160762/1 "2009-02-19T13:37:43Z")

</div>

Hallo,

ich war vollkommen naiv davon ausgegangen, daß die UTF-8-Codierung bei  
sqlite  
auch bedeuten würde, daß die Umlautsortierung funktioniert. Dem ist wohl nicht  
so. Bei MySql kann ich ja die Zeichensatz und collation direkt beim  
Erstellen  
der Datenbank mitgeben.

Weiß jemand, wie ich sqlite dazu bringe, die Umlaute nach deutscher  
Sortierung  
zu sortieren? Ja, für die Schlaumeier, ich weiß, es gibt zwei Regeln in der  
deutschen Sprache für Umlautsortierung. Eine davon würde mir fürs erste reichen.

Hat jemand einen Tip?

Viele  
Grüße  
Michael K.

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [February 19, 2009, 2:13pm UTC](https://www.ruby-forum.com/t/umlautsortierung-sqlite/160762/2 "2009-02-19T14:13:07Z")

</div>

Hallo Michael!  
Zitat aus der FAQ(18) von [sqlite.org](http://sqlite.org):

Q: Case-insensitive matching of Unicode characters does not work.

A: The default configuration of SQLite only supports case-insensitive  
comparisons of ASCII characters. The reason for this is that doing full  
unicode case-insensitive comparisons and case conversions requires  
tables  
and logic that would nearly double the size of the SQLite library. The  
SQLite developers reason that any application that needs full unicode  
case  
support probably already has the necessary tables and functions and so  
SQLite should not take up space to duplicate this ability.

Instead of providing full unicode case support by default, SQLite  
provides  
the ability to link against external unicode comparison and conversion  
routines. The application can overload the built-in  
NOCASE[http://www.sqlite.org/datatype3.html#collation](http://www.sqlite.org/datatype3.html#collation) collating  
sequence (using  
sqlite3\_create\_collation()[http://www.sqlite.org/c3ref/create\_collation.html](http://www.sqlite.org/c3ref/create_collation.html))  
and the built-in like() [http://www.sqlite.org/lang\_corefunc.html#like](http://www.sqlite.org/lang_corefunc.html#like),  
upper() [http://www.sqlite.org/lang\_corefunc.html#upper](http://www.sqlite.org/lang_corefunc.html#upper),  
andlower()[http://www.sqlite.org/lang\_corefunc.html#lower](http://www.sqlite.org/lang_corefunc.html#lower) functions  
(using  
sqlite3\_create\_function()[http://www.sqlite.org/c3ref/create\_function.html](http://www.sqlite.org/c3ref/create_function.html)).  
The SQLite source code includes an “ICU” extension that does these  
overloads. Or, developers can write their own overloads based on their  
own  
unicode-aware comparison routines already contained within their  
project.

Sieht wohl schlecht aus - mit SQLite.

Viele GrÃ¼ÃŸe  
Nicolai

---

<div class="post-metadata">

**Author:** ![mrkohrea](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/4491bb/32.png) [@mrkohrea](https://www.ruby-forum.com/u/mrkohrea)\
**Post date:** [February 19, 2009, 2:35pm UTC](https://www.ruby-forum.com/t/umlautsortierung-sqlite/160762/3 "2009-02-19T14:35:00Z")

</div>

Na ja, ist nur 'ne kleine Anwendung, die schon produktiv läuft. Dann halt  
wieder  
wie in der Steinzeit:

REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(test,‘ö’,‘oe’),‘A’,‘AE’),‘Ö’,‘OE’),‘ä’,‘ae’),‘ü’,‘ue’),‘Ü’,‘UE’)

Alles Leben ist Problemlösen.

Danke für den Hinweis. Hat mir einiges an Grübelei erspart.

Viele  
Grüße  
Michael

Codeblogger schrieb:
