1punycode_decode(3) libidn punycode_decode(3)
2
3
4
6 punycode_decode - API function
7
9 #include <punycode.h>
10
11 int punycode_decode(size_t input_length, const char [] input, size_t *
12 output_length, punycode_uint [] output, unsigned char [] case_flags);
13
15 size_t input_length
16 The number of ASCII code points in the input array.
17
18 const char [] input
19 An array of ASCII code points (0..7F).
20
21 size_t * output_length
22 The caller passes in the maximum number of code points that
23 it can receive into the output array (which is also the
24 maximum number of flags that it can receive into the
25 case_flags array, if case_flags is not a NULL pointer).
26 On successful return it will contain the number of code
27 points actually output (which is also the number of flags
28 actually output, if case_flags is not a null pointer). The
29 decoder will never need to output more code points than the
30 number of ASCII code points in the input, because of the
31 way the encoding is defined. The number of code points
32 output cannot exceed the maximum possible value of a puny‐
33 code_uint, even if the supplied
34 output_length is greater than that.
35
36 punycode_uint [] output
37 An array of code points like the input argument of puny‐
38 code_encode() (see above).
39
40 unsigned char [] case_flags
41 A NULL pointer (if the flags are not needed by the caller)
42 or an array of boolean values parallel to the output ar‐
43 ray. Nonzero (true, flagged) suggests that the correspond‐
44 ing Unicode character be forced to uppercase by the caller
45 (if possible), and zero (false, unflagged) suggests that it
46 be forced to lowercase (if possible). ASCII code points
47 (0..7F) are output already in the proper case, but their
48 flags will be set appropriately so that applying the flags
49 would be harmless.
50
52 Converts Punycode to a sequence of code points (presumed to be Unicode
53 code points).
54
55 Return value: The return value can be any of the Punycode_status values
56 defined above. If not PUNYCODE_SUCCESS, then
57 output_length , output , and case_flags might contain garbage.
58
60 Report bugs to <help-libidn@gnu.org>.
61 General guidelines for reporting bugs: http://www.gnu.org/gethelp/
62 GNU Libidn home page: http://www.gnu.org/software/libidn/
63
64
66 Copyright © 2002-2021 Simon Josefsson.
67 Copying and distribution of this file, with or without modification,
68 are permitted in any medium without royalty provided the copyright no‐
69 tice and this notice are preserved.
70
72 The full documentation for libidn is maintained as a Texinfo manual.
73 If the info and libidn programs are properly installed at your site,
74 the command
75
76 info libidn
77
78 should give you access to the complete manual. As an alternative you
79 may obtain the manual from:
80
81 http://www.gnu.org/software/libidn/manual/
82
83libidn 1.38 punycode_decode(3)