To support characters with an accent in the database, you can use the Normalizer class to save text correctly:
import java.text.Normalizer; ... // Code to store the normalized data ContentValues values = new ContentValues(); values.put(COLUMN_NAME, Normalizer.normalize(name, Normalizer.Form.NFD)); ... // Code to read the normalized data int indexName = cursor.getColumnIndex(COLUMN_NAME) String name = Normalizer.normalize(cursor.getString(indexName), Normalizer.Form.NFC));
By storing data this way, statemants SQLite ASC and DESC work correctly with accented characters.
Bismark ito
source share