7.6. Simplified ToASCII Interface

int idna_to_ascii_4z (const uint32_t * input, char ** output, int flags) input: zero terminated input Unicode string.

output: pointer to newly allocated output string.

flags: IDNA flags, e.g. IDNA_ALLOW_UNASSIGNED or IDNA_USE_STD3_ASCII_RULES.

Convert UCS-4 domain name to ASCII string. The domain name may contain several labels, separated by dots. The output buffer must be deallocated by the caller.

Return value: Returns IDNA_SUCCESS on success, or error code.

int idna_to_ascii_8z (const char * input, char ** output, int flags) input: zero terminated input UTF-8 string.

output: pointer to newly allocated output string.

flags: IDNA flags, e.g. IDNA_ALLOW_UNASSIGNED or IDNA_USE_STD3_ASCII_RULES.

Convert UTF-8 domain name to ASCII string. The domain name may contain several labels, separated by dots. The output buffer must be deallocated by the caller.

Return value: Returns IDNA_SUCCESS on success, or error code.

int idna_to_ascii_lz (const char * input, char ** output, int flags) input: zero terminated input UTF-8 string.

output: pointer to newly allocated output string.

flags: IDNA flags, e.g. IDNA_ALLOW_UNASSIGNED or IDNA_USE_STD3_ASCII_RULES.

Convert domain name in the locale's encoding to ASCII string. The domain name may contain several labels, separated by dots. The output buffer must be deallocated by the caller.

Return value: Returns IDNA_SUCCESS on success, or error code.