Search code examples
javaandroidstringrealm

Get diacritic insensitive results from Realm database query


I'm in trouble with a simple query to get strings from Realm engine in Java for an Android app. As said in the title of my topic, I want to get diacritic insensitive results from my query.

Example: If user type the word "securite", I want my query to return "securite" and "sécurité".

How can I do that ?

Thanks a lot in advance for your help !


Solution

  • While Realm doesn't support that currently. Depending on how much of the data you control, you can also add a "normalized" field you can use in your search. There is an approach described here: Remove diacritics from string in Java