I need a method in c#/.net that can take any string, with lots of weird characters, as input and produce a valid subdomain that is as close to the input as possible.
Example: Input: Øyvind & René's Company Ltd. Output: oyvindrenescompanyltd.example.com
Does anyone know of a .net library that can help me do this conversion?
It's easy to just remove all characters not valid in a subdomain, but if I have to replace a lot of characters (ø -> o, é -> e) then it's not trivial to capture all the variations.