| host_normalize | R Documentation |
Converts DNS hostnames to their canonical comparison form following the ratified canonical-host normalization contract: Unicode NFC, case mapping, UTS-46 label mapping and validation (non-transitional, with 'UseSTD3ASCIIRules', 'CheckHyphens', 'CheckBidi', and 'CheckJoiners'), conversion to lowercase ASCII A-labels, and DNS length verification, while preserving whether the input carried a single terminal root dot.
host_normalize(x, strict = TRUE)
x |
Character vector of hostnames. 'NA' elements pass through as 'NA' (missing, not invalid). Names are preserved. |
strict |
Logical scalar. 'TRUE' (the default) applies the full profile. 'strict = FALSE' is reserved for a future documented relaxed variant and currently behaves identically to 'TRUE'. This function never reads the 'punycoder.strict' option. |
Unlike [puny_encode()], invalid input is reported by returning 'NA_character_' (never by aborting), so a caller can layer its own policy. The profile is fixed at one pinned Unicode version per release; see [normalization_profile_info()] for the machine-readable identity.
A character vector the same length as 'x'. Each element is the canonical lowercase ASCII A-label host, or 'NA_character_' when the input is 'NA' or invalid under the profile.
[normalization_profile_info()] for the profile identity, [puny_encode()] for the lower-level RFC 3492 transform.
host_normalize(c("Example.COM", "münchen.de", "example.com."))
host_normalize("a_b.com") # NA: STD3 rejects "_"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.