NetSurf
Macros | Functions
idna.h File Reference

interface to international domain name handling. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IDNA_UNICODE_CCC_VIRAMA   9
 Unicode canonical combining class for virama. More...
 

Functions

nserror idna_encode (const char *host, size_t len, char **ace_host, size_t *ace_len)
 Convert a hostname to an ACE version suitable for DNS lookup. More...
 
nserror idna_decode (const char *ace_host, size_t ace_len, char **host, size_t *host_len)
 Convert a hostname from ACE to UTF-8 suitable for display. More...
 

Detailed Description

interface to international domain name handling.

Definition in file idna.h.

Macro Definition Documentation

◆ IDNA_UNICODE_CCC_VIRAMA

#define IDNA_UNICODE_CCC_VIRAMA   9

Unicode canonical combining class for virama.

Definition at line 30 of file idna.h.

Function Documentation

◆ idna_decode()

nserror idna_decode ( const char *  ace_host,
size_t  ace_len,
char **  host,
size_t *  host_len 
)

Convert a hostname from ACE to UTF-8 suitable for display.

Parameters
ace_hostString containing host
ace_lenLength of host string
hostPointer to update with the output
host_lenPointer to update with length of host
Returns
NSERROR_OK on success, appropriate error otherwise

If return value != NSERROR_OK, output will be left untouched.

Definition at line 785 of file idna.c.

References FQDN_APPEND, FQDN_MAX, idna__ace_to_ucs4(), idna__host_label_length(), idna__is_ace(), idna__ucs4_to_utf8(), NO_ACTION, NSERROR_BAD_URL, and NSERROR_OK.

Here is the call graph for this function:

◆ idna_encode()

nserror idna_encode ( const char *  host,
size_t  len,
char **  ace_host,
size_t *  ace_len 
)

Convert a hostname to an ACE version suitable for DNS lookup.

Parameters
hostString containing host
lenLength of host string
ace_hostPointer to update with the output
ace_lenPointer to update with length of ace_host
Returns
NSERROR_OK on success, appropriate error otherwise

If return value != NSERROR_OK, output will be left untouched.

Definition at line 713 of file idna.c.

References FQDN_APPEND, FQDN_MAX, idna__host_label_length(), idna__is_ace(), idna__is_ldh(), idna__is_valid(), idna__ucs4_to_ace(), idna__utf8_to_ucs4(), idna__verify(), NO_ACTION, NSERROR_BAD_URL, NSERROR_OK, and NSLOG.

Here is the call graph for this function: