How to convert IDN to ASCII?

人盡茶涼 提交于 2019-11-28 23:34:19

Have a look at the GNU IDN Library - Libidn. The introduction says that C# libraries are available.

adam
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 :)

MSDN

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!