punycode

Name

punycode -- Punycode: A Bootstring encoding of Unicode for IDNA.

Synopsis



int         punycode_encode                 (size_t input_length,
                                             unsigned long input[],
                                             unsigned char case_flags[],
                                             size_t *output_length,
                                             char output[]);
int         punycode_decode                 (size_t input_length,
                                             const char input[],
                                             size_t *output_length,
                                             unsigned long output[],
                                             unsigned char case_flags[]);

Description

Punycode is a simple and efficient transfer encoding syntax designed for use with Internationalized Domain Names in Applications. It uniquely and reversibly transforms a Unicode string into an ASCII string. ASCII characters in the Unicode string are represented literally, and non-ASCII characters are represented by ASCII characters that are allowed in host name labels (letters, digits, and hyphens). This document defines a general algorithm called Bootstring that allows a string of basic code points to uniquely represent any string of code points drawn from a larger set. Punycode is an instance of Bootstring that uses particular parameter values specified by this document, appropriate for IDNA.

Details

punycode_encode ()

int         punycode_encode                 (size_t input_length,
                                             unsigned long input[],
                                             unsigned char case_flags[],
                                             size_t *output_length,
                                             char output[]);

Converts Unicode to Punycode.


punycode_decode ()

int         punycode_decode                 (size_t input_length,
                                             const char input[],
                                             size_t *output_length,
                                             unsigned long output[],
                                             unsigned char case_flags[]);

Converts Punycode to Unicode.