• Post Reply Bookmark Topic Watch Topic
  • New Topic

Search texting that includes special characters, e.g. ã, é or í  RSS feed

 
Harold Lime
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is there a search method that can match special characters with their standard counterpart?

For example:
I'd like a search for "Sao" to find a match in "São Tomé and Príncipe" etc.

I don't really know where to start, I could store the country name twice, once as regular and once including special characters, but then I'd have to search both...

I'm hoping someone has a better idea.

 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider java.text.RuleBasedCollator class.

Here is a code to compare strings with polish characters and their counterparts (ą=a, ł=l etc.):


Of course code says that these two strings are identical
I didnt test this class in practice, probably performance could be the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!