I have some text imported from sqlite database and then I set that text to some button. Now, I have some text like München, or Stanković, or Kazalište. You get the point. User has to guess the right answer and I solved the issue when user insert lowercase word, and my word is with first letter capital. I just convert my word and his entered word to uppercase. But how to accept the answer even if user enter Munchen, or Stankovic or Kazaliste, without those special letters that I have in my database?
Asked
Active
Viewed 4,880 times
2
-
2http://stackoverflow.com/a/3322174/106261 – NimChimpsky Apr 03 '13 at 13:09
-
This looks very similiar to [this question](http://stackoverflow.com/q/1453171/1343161). – Keppil Apr 03 '13 at 13:09
-
This may help http://stackoverflow.com/questions/1008802/converting-symbols-accent-letters-to-english-alphabet – Serkan Arıkuşu Apr 03 '13 at 13:16
3 Answers
0
Try using collator.
Performing Locale-Independent Comparisons
Collation rules define the sort sequence of strings. These rules vary with locale, because various natural languages sort words differently. You can use the predefined collation rules provided by the Collator class to sort strings in a locale-independent manner.

Achintya Jha
- 12,735
- 2
- 27
- 39
0
I think you'll need to explicitly replace all the special characters with the acceptable characters. So, ü -> u and so on. Just as you have done by using toUpperCase which substitutes u with U.

Tom Carchrae
- 6,398
- 2
- 37
- 36
0
String expression ="š|ć|ü";
Pattern pattern = Pattern.compile(expression, Pattern.CASE_INSENSITIVE);
Matcher matcher = pattern.matcher(inputStr);
if (matcher.matches())
{
//your code
}

Bhavesh Jethani
- 3,891
- 4
- 24
- 42