8n8 / elm-string-normalize / RemoveDiacritics

Remove diacritics from a string. This is handy for normalizing strings before sorting, to give a more natural sort.

removeDiacritics : String -> String

removeDiacritics removes diactritics, it will expand known ligatures, thus changing the string glyph length. All non latin characters are untouched.

removeDiacritics "La liberté commence où l'ignorance finit."

--> "La liberte commence ou l'ignorance finit."
removeDiacritics "é()/& abc" --> "e()/& abc"

removeDiacritics "こんにちは" --> "こんにちは"

lookupTable : Dict Char String

The table of characters with diacritics, and the strings that they are replaced by.