encoding_decoding_punycode
Encode internationalized domain names to ASCII xn-- Punycode form and decode xn-- labels back to Unicode. Converts each dot-separated label independently per RFC 3492 without network lookup.
Instructions
Punycode / IDN Encoder and Decoder. Encode an internationalized domain name to its ASCII xn-- form (Punycode, RFC 3492 / IDNA) and decode xn-- labels back to Unicode. Pure in-process compute, no DNS or network lookup. Use this for domain-name (host) encoding where each dot-separated label is converted independently and only non-ASCII labels gain the xn-- prefix; use encoding_decoding_url for percent-encoding URL paths/query strings and encoding_decoding_unicode for backslash-u / backslash-x / HTML escapes of arbitrary text. Read-only and idempotent; rate limited to 60 requests/min anonymous (120 authenticated). Returns the converted string plus a per-label breakdown and a non-ASCII character listing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Input to convert. For encode: a Unicode domain (e.g. münchen.de) or a single label; a value containing a dot with no spaces is treated as a domain and each label encoded separately. For decode: an xn-- ASCII string or full ASCII domain containing xn-- labels. | |
| operation | Yes | Direction of conversion. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| success | No | True when conversion succeeded. | |
| input | No | The original text submitted. | |
| operation | No | The operation performed (encode or decode). | |
| result | No | Converted output — xn-- ASCII for encode, Unicode for decode. | |
| domain_analysis | No | Per-label breakdown when input is domain-like, else empty. | |
| character_info | No | Up to 20 unique non-ASCII characters in the input (encode only), else empty. |