overbet13
overbet13

Reputation: 1684

Unicode string matching

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.

Upvotes: 3

Views: 333

Answers (1)

Marko Topolnik
Marko Topolnik

Reputation: 200168

What you are looking for is the Collator API.

Upvotes: 5

Related Questions