Twig filter to convert special characters to URL friendly characters I have a text field that will accept some German text in it as a headline of a section. I'm using Craft's |kebab filter to turn that into a lowercase-with-dashes id that my navigation scrolls down to when its corresponding link is clicked.

However, when there's a word like "Über Uns", the umlaut Ü stays in the output like so: "über-uns" and this messes up my javascript so the scrolling doesn't work for that one item. Is there a filter or something to have it be output to "ueber-uns"?
My first idea would be to use the url_encode filter than would turn your special characters into a URL friendly format. I imagine these would also be Javascript friendly.

If you'd like to convert the characters to something like "ueber-uns" maybe take a look at the convert_encoding filter in Twig. It uses a function called mb-convert-encoding.

I tried to find what encoding you'd need to use to convert Ü to something javascript friendly but was only able print even more obscure characters.