Either
... ORDER BY column COLLATE UNICODE
or
... ORDER BY column COLLATE LOCALIZED
Reference:
In addition to SQLite's default BINARY
collator, Android supplies two more, LOCALIZED
, which changes with the system's current locale, and UNICODE
, which is the Unicode Collation Algorithm and not tailored to the current locale.
Example:
db.execSQL("CREATE TABLE foo(a TEXT);");
db.execSQL("INSERT INTO foo VALUES('Antonio'),('Bonzo'),('Zeto'),('ángela');");
Cursor c = db.rawQuery("SELECT * FROM foo ORDER BY a COLLATE UNICODE", null);
while (c.moveToNext()) {
Log.d("foo", c.getString(0));
}
Output:
ángela
Antonio
Bonzo
Zeto
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…