Skip to main content

is_punnycode_domain

No overview available.

def is_punnycode_domain(
domain: string
) - > boolean

Determines if a domain name contains Punycode-encoded labels by checking for the 'xn--' prefix. Use this to identify Internationalized Domain Names (IDNs) that require decoding for human-readable display.

Parameters

NameTypeDescription
domainstringThe fully qualified domain name or domain segment to be inspected for Punycode encoding

Returns

TypeDescription
booleanTrue if the domain contains at least one Punycode-encoded segment, False otherwise