Unicode string matching

java, string, string-matching, unicode

Solution

What you are looking for is the Collator API.

Problem

I want to match two strings with Unicode encoding in Java. I want to match something like: ``` "asdfeo" "ásdfeó" ``` How can I return 0 in the `compareTo()` method? EDIT: When I type a string into an autocomplete view without diacritics (for some reason I don't have the keyboard to write those diacritics), I want to see between the autocomplete suggestions the objects with diacritics. That is why I want to overwrite the `compareTo()` method.

Original source

Related problems