What is the best way to convert an internationalized domain name to its ASCII-form?
I want to convert Bücher.ch
into xn--bcher-kva.ch
by using some sort of (free) .net code.
What is the best way to convert an internationalized domain name to its ASCII-form?
I want to convert Bücher.ch
into xn--bcher-kva.ch
by using some sort of (free) .net code.
Have a look at the GNU IDN Library - Libidn. The introduction says that C# libraries are available.
using System.Globalization;
...
IdnMapping idn = new IdnMapping();
MessageBox.Show(idn.GetAscii("www.kraków.pl"));
To Get the other way around from xn--bcher-kva.ch domain to Bücher.ch
using System.Globalization;
...
IdnMapping idn = new IdnMapping();
MessageBox.Show(idn.GetUnicode("xn--bcher-kva.ch"));
You will get www.kraków.pl as result. Because i came here to look for this :) hope it is helpful for others as well :)
Have a look at the GNU IDN Library - Libidn. The introduction says that C# libraries are available.
© 2022 - 2024 — McMap. All rights reserved.