idna

idna

Synopsis

#define             IDNAPI
enum                Idna_rc;
enum                Idna_flags;
#define             IDNA_ACE_PREFIX
const char *        idna_strerror                       (Idna_rc rc);
int                 idna_to_ascii_4i                    (const uint32_t *in,
                                                         size_t inlen,
                                                         char *out,
                                                         int flags);
int                 idna_to_unicode_44i                 (const uint32_t *in,
                                                         size_t inlen,
                                                         uint32_t *out,
                                                         size_t *outlen,
                                                         int flags);
int                 idna_to_ascii_4z                    (const uint32_t *input,
                                                         char **output,
                                                         int flags);
int                 idna_to_ascii_8z                    (const char *input,
                                                         char **output,
                                                         int flags);
int                 idna_to_ascii_lz                    (const char *input,
                                                         char **output,
                                                         int flags);
int                 idna_to_unicode_4z4z                (const uint32_t *input,
                                                         uint32_t **output,
                                                         int flags);
int                 idna_to_unicode_8z4z                (const char *input,
                                                         uint32_t **output,
                                                         int flags);
int                 idna_to_unicode_8z8z                (const char *input,
                                                         char **output,
                                                         int flags);
int                 idna_to_unicode_8zlz                (const char *input,
                                                         char **output,
                                                         int flags);
int                 idna_to_unicode_lzlz                (const char *input,
                                                         char **output,
                                                         int flags);

Description

Details

IDNAPI

#define             IDNAPI


enum Idna_rc

  typedef enum
  {
    IDNA_SUCCESS = 0,
    IDNA_STRINGPREP_ERROR = 1,
    IDNA_PUNYCODE_ERROR = 2,
    IDNA_CONTAINS_NON_LDH = 3,
    /* Workaround typo in earlier versions. */
    IDNA_CONTAINS_LDH = IDNA_CONTAINS_NON_LDH,
    IDNA_CONTAINS_MINUS = 4,
    IDNA_INVALID_LENGTH = 5,
    IDNA_NO_ACE_PREFIX = 6,
    IDNA_ROUNDTRIP_VERIFY_ERROR = 7,
    IDNA_CONTAINS_ACE_PREFIX = 8,
    IDNA_ICONV_ERROR = 9,
    /* Internal errors. */
    IDNA_MALLOC_ERROR = 201,
    IDNA_DLOPEN_ERROR = 202
  } Idna_rc;

Enumerated return codes of idna_to_ascii_4i(), idna_to_unicode_44i() functions (and functions derived from those functions). The value 0 is guaranteed to always correspond to success.

IDNA_SUCCESS

Successful operation. This value is guaranteed to always be zero, the remaining ones are only guaranteed to hold non-zero values, for logical comparison purposes.

IDNA_STRINGPREP_ERROR

Error during string preparation.

IDNA_PUNYCODE_ERROR

Error during punycode operation.

IDNA_CONTAINS_NON_LDH

For IDNA_USE_STD3_ASCII_RULES, indicate that the string contains non-LDH ASCII characters.

IDNA_CONTAINS_LDH

IDNA_CONTAINS_MINUS

For IDNA_USE_STD3_ASCII_RULES, indicate that the string contains a leading or trailing hyphen-minus (U+002D).

IDNA_INVALID_LENGTH

The final output string is not within the (inclusive) range 1 to 63 characters.

IDNA_NO_ACE_PREFIX

The string does not contain the ACE prefix (for ToUnicode).

IDNA_ROUNDTRIP_VERIFY_ERROR

The ToASCII operation on output string does not equal the input.

IDNA_CONTAINS_ACE_PREFIX

The input contains the ACE prefix (for ToASCII).

IDNA_ICONV_ERROR

Could not convert string in locale encoding.

IDNA_MALLOC_ERROR

Could not allocate buffer (this is typically a fatal error).

IDNA_DLOPEN_ERROR

Could not dlopen the libcidn DSO (only used internally in libc).

enum Idna_flags

  typedef enum
  {
    IDNA_ALLOW_UNASSIGNED = 0x0001,
    IDNA_USE_STD3_ASCII_RULES = 0x0002
  } Idna_flags;

Flags to pass to idna_to_ascii_4i(), idna_to_unicode_44i() etc.

IDNA_ALLOW_UNASSIGNED

Don't reject strings containing unassigned Unicode code points.

IDNA_USE_STD3_ASCII_RULES

Validate strings according to STD3 rules (i.e., normal host name rules).

IDNA_ACE_PREFIX

#  define IDNA_ACE_PREFIX "xn--"

The IANA allocated prefix to use for IDNA. "xn--"


idna_strerror ()

const char *        idna_strerror                       (Idna_rc rc);

rc :

Returns :


idna_to_ascii_4i ()

int                 idna_to_ascii_4i                    (const uint32_t *in,
                                                         size_t inlen,
                                                         char *out,
                                                         int flags);

in :

inlen :

out :

flags :

Returns :


idna_to_unicode_44i ()

int                 idna_to_unicode_44i                 (const uint32_t *in,
                                                         size_t inlen,
                                                         uint32_t *out,
                                                         size_t *outlen,
                                                         int flags);

in :

inlen :

out :

outlen :

flags :

Returns :


idna_to_ascii_4z ()

int                 idna_to_ascii_4z                    (const uint32_t *input,
                                                         char **output,
                                                         int flags);

input :

output :

flags :

Returns :


idna_to_ascii_8z ()

int                 idna_to_ascii_8z                    (const char *input,
                                                         char **output,
                                                         int flags);

input :

output :

flags :

Returns :


idna_to_ascii_lz ()

int                 idna_to_ascii_lz                    (const char *input,
                                                         char **output,
                                                         int flags);

input :

output :

flags :

Returns :


idna_to_unicode_4z4z ()

int                 idna_to_unicode_4z4z                (const uint32_t *input,
                                                         uint32_t **output,
                                                         int flags);

input :

output :

flags :

Returns :


idna_to_unicode_8z4z ()

int                 idna_to_unicode_8z4z                (const char *input,
                                                         uint32_t **output,
                                                         int flags);

input :

output :

flags :

Returns :


idna_to_unicode_8z8z ()

int                 idna_to_unicode_8z8z                (const char *input,
                                                         char **output,
                                                         int flags);

input :

output :

flags :

Returns :


idna_to_unicode_8zlz ()

int                 idna_to_unicode_8zlz                (const char *input,
                                                         char **output,
                                                         int flags);

input :

output :

flags :

Returns :


idna_to_unicode_lzlz ()

int                 idna_to_unicode_lzlz                (const char *input,
                                                         char **output,
                                                         int flags);

input :

output :

flags :

Returns :