1idn2_to_ascii_4i2(3) libidn2 idn2_to_ascii_4i2(3)
2
3
4
6 idn2_to_ascii_4i2 - API function
7
9 #include <idn2.h>
10
11 int idn2_to_ascii_4i2(const uint32_t * input, size_t inlen, char **
12 output, int flags);
13
15 const uint32_t * input
16 zero terminated input Unicode (UCS-4) string.
17
18 size_t inlen
19 number of elements in input .
20
21 char ** output
22 pointer to newly allocated zero-terminated output string.
23
24 int flags optional idn2_flags to modify behaviour.
25
27 The ToASCII operation takes a sequence of Unicode code points that make
28 up one domain label and transforms it into a sequence of code points in
29 the ASCII range (0..7F). If ToASCII succeeds, the original sequence and
30 the resulting sequence are equivalent labels.
31
32 It is important to note that the ToASCII operation can fail. ToASCII
33 fails if any step of it fails. If any step of the ToASCII operation
34 fails on any label in a domain name, that domain name MUST NOT be used
35 as an internationalized domain name. The method for dealing with this
36 failure is application-specific.
37
38 The inputs to ToASCII are a sequence of code points.
39
40 ToASCII never alters a sequence of code points that are all in the
41 ASCII range to begin with (although it could fail). Applying the
42 ToASCII operation multiple effect as applying it just once.
43
44 The default behavior of this function (when flags are zero) is to apply
45 the IDNA2008 rules without the TR46 amendments. As the TR46 non-transi‐
46 tional processing is nowadays ubiquitous, when unsure, it is recom‐
47 mended to call this function with the IDN2_NONTRANSITIONAL and the
48 IDN2_NFC_INPUT flags for compatibility with other software.
49
50 Return value: Returns IDN2_OK on success, or error code.
51
53 2.1.1
54
56 Report bugs to <help-libidn@gnu.org>.
57 General guidelines for reporting bugs: https://www.gnu.org/gethelp/
58 Libidn2 home page: https://www.gnu.org/software/libidn2/
59
60
62 Copyright © 2002-2022 Simon Josefsson.
63 Copying and distribution of this file, with or without modification,
64 are permitted in any medium without royalty provided the copyright no‐
65 tice and this notice are preserved.
66
68 The full documentation for libidn2 is maintained as a Texinfo manual.
69 If the info and libidn2 programs are properly installed at your site,
70 the command
71
72 info libidn2
73
74 should give you access to the complete manual. As an alternative you
75 may obtain the manual from:
76
77 https://www.gnu.org/software/libidn/libidn2/manual/
78
79libidn2 2.3.3 idn2_to_ascii_4i2(3)