| puny_decode | R Documentation |
Converts ASCII Punycode (xn--) domain names back to their Unicode
representation. This is the inverse of puny_encode() and is the raw RFC
3492 transform with A-label framing checks. DNS host length limits are
intentionally not applied by this raw codec; use validate_domain() or
host_normalize() when you need DNS host validation.
puny_decode(x, strict = getOption("punycoder.strict", TRUE))
x |
Character vector of ASCII punycode domains to decode |
strict |
Logical; whether to apply strict validation. Defaults to
|
Like puny_encode(), this is a low-level ASCII-Compatible Encoding
helper, not an IDNA normalization API: it does not apply UTS #46 mapping
or NFC. For IDNA/UTS-46 host normalization, see host_normalize().
A character vector the same length as x, with each element
containing the Unicode-decoded domain name. Elements corresponding to
NA inputs are NA_character_. In non-strict mode, domains
that fail decoding are also returned as NA_character_.
puny_encode for the reverse operation,
host_normalize for IDNA/UTS-46 host normalization,
url_decode for full URL decoding.
# Basic decoding
puny_decode("xn--caf-dma.com")
puny_decode("xn--80adxhks.xn--p1ai")
# Vectorized decoding
ascii_domains <- c("xn--caf-dma.com", "xn--80adxhks.xn--p1ai")
puny_decode(ascii_domains)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.