How to replace accented letters with ASCII letters?

Elixir support the Unicode flag in Regex

You can simply use

String.normalize("NäytẗkuvaèüÀÁÂÃĀĂȦÄẢÅǍȀȂĄẠḀẦẤàáâä", :nfd) |> String.replace(~r/\W/u, "")
"NayttkuvaeuAAAAAAAAAAAAAAAAAAaaaa"

this one will strip white spaces and special characters diacritical marks (accents and such) but keep numbers

2 Likes