7

What's the best alternative to to java.text.Normalizer in android versions previous than 2.3? http://developer.android.com/reference/java/text/Normalizer.html

I need to match Strings like

perché perchè perche

thanks

Nicola

Nicola Montecchio
  • 477
  • 1
  • 7
  • 18

1 Answers1

3

I have two solutions:

1.) Get the source for Normalizer from here and here. (it's a few thousand lines)

2.) Build a simple translation HashMap yourself. Maybe your will have just French users for some time? This is a suboptimal solution but practical until your app goes worldwide.

Martin Konicek
  • 39,126
  • 20
  • 90
  • 98
  • In the end I did solution 2. Might not be very elegant, but it works for me :) – Nicola Montecchio Jul 25 '11 at 07:12
  • I have tried to get the source for Normalizer. But on runtime I get: 1E/AndroidRuntime(29681): java.lang.ExceptionInInitializerError E/AndroidRuntime(29681): Caused by: java.lang.RuntimeException: could not locate data – sealskej Dec 20 '11 at 12:46