punycodeEncodeLabel

fnstring punycodeEncodeLabel(string label) @safe

Encode a single DNS label to Punycode (without adding the xn-- prefix).

Basic ASCII code points are copied; non-ASCII code points are Punycode-encoded.

Parameters

labelUnicode label to encode.

Returns

The encoded ASCII label (without xn--).

Throws

Exception if an internal invariant is violated or output length constraints fail.