How to remove accents from a String
My little puzzle of the day is to find how to remove accents from a String. There are different alternatives, different strategies, but none really suits my needs – or my taste.
The naive approach is to use String.replace()
to replace manually all characters, with a correspondance table, like “Γ©” should be replaced with “e”, etc. That’s fine for some languages I know, like French or German, or even some latin languages, since we share the same alphabet. But with Russian, Greek, or some asian languages, my knowledge won’t suffice! So I can’t reliably produce a big hashtable with that knowledge. What a pity!