Skip to contents

Determines whether a domain name contains Unicode characters that would require punycode encoding for ASCII compatibility.

Usage

is_idn(x)

Arguments

x

Character vector of domain names to test

Value

A logical vector the same length as x, where TRUE indicates the element contains non-ASCII Unicode characters.

See also

is_punycode for detecting punycode domains, puny_encode for encoding Unicode domains.

Examples

# \donttest{
is_idn("caf\u00E9.com") # TRUE
#> [1] TRUE
is_idn("example.com") # FALSE
#> [1] FALSE
is_idn(c(
  "caf\u00E9.com",
  "\u043C\u043E\u0441\u043A\u0432\u0430.\u0440\u0444",
  "test.com"
)) # c(TRUE, TRUE, FALSE)
#> [1]  TRUE  TRUE FALSE
# }