Learn R Programming

punycoder (version 1.1.0)

puny_decode: Decode ASCII punycode to Unicode domains

Description

Converts ASCII punycode domain names back to their Unicode representation. This is the reverse operation of puny_encode and is useful for displaying human-readable domain names.

Usage

puny_decode(x, strict = getOption("punycoder.strict", TRUE))

Value

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_.

Arguments

x

Character vector of ASCII punycode domains to decode

strict

Logical; whether to apply strict validation. Defaults to `getOption("punycoder.strict", TRUE)`.

See Also

puny_encode for the reverse operation, url_decode for full URL decoding.

Examples

Run this code
# \donttest{
# 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)
# }

Run the code above in your browser using DataLab