idna

idna

Synopsis

#define             IDNA_API
enum                Idna_rc;
enum                Idna_flags;
#define             IDNA_ACE_PREFIX

Description

A longer description goes here.

Details

IDNA_API

#define             IDNA_API

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--"