Twig filter to convert special characters to URL friendly characters
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.