Top |
const char *
punycode_strerror (Punycode_status rc
);
Convert a return code integer to a text string. This string can be used to output a diagnostic message to the user.
PUNYCODE_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. PUNYCODE_BAD_INPUT: Input is invalid. PUNYCODE_BIG_OUTPUT: Output would exceed the space provided. PUNYCODE_OVERFLOW: Input needs wider integers to process.
int punycode_encode (size_t input_length
,const punycode_uint input[]
,const unsigned char case_flags[]
,size_t *output_length
,char output[]
);
Converts a sequence of code points (presumed to be Unicode code points) to Punycode.
input_length |
The number of code points in the |
|
input |
An array of code points. They are presumed to be Unicode code points, but that is not strictly REQUIRED. The array contains code points, not code units. UTF-16 uses code units D800 through DFFF to refer to code points 10000..10FFFF. The code points D800..DFFF do not occur in any valid Unicode string. The code points that can occur in Unicode strings (0..D7FF and E000..10FFFF) are also called Unicode scalar values. |
|
case_flags |
A |
|
output_length |
The caller passes in the maximum number of ASCII code points that it can receive. On successful return it will contain the number of ASCII code points actually output. |
|
output |
An array of ASCII code points. It is *not*
null-terminated; it will contain zeros if and only if the |
The return value can be any of the Punycode_status
values defined above except PUNYCODE_BAD_INPUT
. If not
PUNYCODE_SUCCESS
, then output_size
and output
might contain
garbage.
int punycode_decode (size_t input_length
,const char input[]
,size_t *output_length
,punycode_uint output[]
,unsigned char case_flags[]
);
Converts Punycode to a sequence of code points (presumed to be Unicode code points).
input_length |
The number of ASCII code points in the |
|
input |
An array of ASCII code points (0..7F). |
|
output_length |
The caller passes in the maximum number of code
points that it can receive into the |
|
output |
An array of code points like the input argument of
|
|
case_flags |
A |
The return value can be any of the Punycode_status
values defined above. If not PUNYCODE_SUCCESS
, then
output_length
, output
, and case_flags
might contain garbage.
#define IDNAPI
Symbol holding shared library API visibility decorator.
This is used internally by the library header file and should never be used or modified by the application.
https://www.gnu.org/software/gnulib/manual/html_node/Exported-Symbols-of-Shared-Libraries.html
Enumerated return codes of punycode_encode()
and punycode_decode()
.
The value 0 is guaranteed to always correspond to success.