223. Punycode

DNS Punycode Handling

223.1. Summary of Module Globals

List of Global Functions

  • DecodeDomainName - Decodes the domain name (relative or FQDN) from the Punycode.

  • DecodePunycodes - Converts list of Punycode strings into their UTF-8 representation.

  • DocodeDomainNames - Decodes the list of domain names to their Unicode representation. This function is similar to DecodePunycodes but it works with every string as a domain name (that means every domain name is parsed by dots and separately evaluated).

  • EncodeDomainName - Encodes the domain name (relative or FQDN) to the Punycode.

  • EncodePunycodes - Converts list of UTF-8 strings into their Punycode ASCII repserentation.

  • GetMaximumCacheSize - Returns the maximum cache size (sum of already converted strings).

  • SetMaximumCacheSize - Offers to set the maximum cache size (sum of already converted strings).

List of Global Variables

    223.2. Global Functions

    223.2.1. DecodeDomainName

    Decodes the domain name (relative or FQDN) from the Punycode.

    Function parameters

    • string encoded_domain_name

    Return value

    • string - decoded domain_name

    Example 78. 

    	DecodeDomainName("xn--ala-qma83eb.xn--jlinka-3mb.go.home")
    		-> "ŞíŞala.jůlinka.go.home"


    223.2.2. DecodePunycodes

    Converts list of Punycode strings into their UTF-8 representation.

    Function parameters

    • list <string> punycode_strings

    Return value

    • list <string> - decoded_strings

    223.2.3. DocodeDomainNames

    Decodes the list of domain names to their Unicode representation. This function is similar to DecodePunycodes but it works with every string as a domain name (that means every domain name is parsed by dots and separately evaluated).

    Function parameters

    • list <string> encoded_domain_names

    Return value

    • list <string> - decoded_domain_names

    Example 79. 

     	DocodeDomainNames(["mx1.example.org", "xp3.example.org.", "xn--ala-qma83eb.org.example."])
    		-> ["mx1.example.org", "xp3.example.org.", "ŞíŞala.org.example."]


    223.2.4. EncodeDomainName

    Encodes the domain name (relative or FQDN) to the Punycode.

    Function parameters

    • string decoded_domain_name

    Return value

    • string - encoded domain_name

    Example 80. 

    	EncodeDomainName("ŞíŞala.jůlinka.go.home")
    		-> "xn--ala-qma83eb.xn--jlinka-3mb.go.home"


    223.2.5. EncodePunycodes

    Converts list of UTF-8 strings into their Punycode ASCII repserentation.

    Function parameters

    • list <string> punycode_strings

    Return value

    • list <string> - encoded_strings

    223.2.6. GetMaximumCacheSize

    Returns the maximum cache size (sum of already converted strings).

    Return value

    • integer - maximum_cache_size

    223.2.7. SetMaximumCacheSize

    Offers to set the maximum cache size (sum of already converted strings).

    Function parameters

    • integer new_max_size

    Return value

    • void

    223.3. Global Variables

    223.4. Module Requirements

    none