punyDecode

Decode the input string using the Punycode algorithm.

Punycode is used to encode UTF domain name segment. A Punycode-encoded segment will be marked with "xn--". Each segment is encoded separately. For instance, if you wish to encode "☂.☃.com" in Punycode, you will get "xn--m3h.xn--n3h.com".

In order to puny-decode a domain name, you must split it into its components. The following will typically suffice:

auto domain = "xn--m3h.xn--n3h.com";
auto decodedDomain = domain.splitter(".").map!(punyDecode).join(".");
@safe
string
punyDecode
(
string input
)

Meta