1punycode_encode(3)                  libidn                  punycode_encode(3)
2
3
4

NAME

6       punycode_encode - API function
7

SYNOPSIS

9       #include <punycode.h>
10
11       int  punycode_encode(size_t input_length, const punycode_uint [] input,
12       const unsigned char [] case_flags, size_t * output_length, char [] out‐
13       put);
14

ARGUMENTS

16       size_t input_length
17                   The number of code points in the input array and the number
18                   of flags in the case_flags array.
19
20       const punycode_uint [] input
21                   An array of code points.  They are presumed to  be  Unicode
22                   code  points, but that is not strictly REQUIRED.  The array
23                   contains code points, not code  units.   UTF-16  uses  code
24                   units   D800   through   DFFF   to  refer  to  code  points
25                   10000..10FFFF.  The code points D800..DFFF do not occur  in
26                   any  valid  Unicode string.  The code points that can occur
27                   in Unicode strings  (0..D7FF  and  E000..10FFFF)  are  also
28                   called Unicode scalar values.
29
30       const unsigned char [] case_flags
31                   A  NULL  pointer  or an array of boolean values parallel to
32                   the input array.  Nonzero (true, flagged) suggests that the
33                   corresponding  Unicode  character  be  forced  to uppercase
34                   after  being  decoded  (if  possible),  and  zero   (false,
35                   unflagged) suggests that it be forced to lowercase (if pos‐
36                   sible).  ASCII code points (0..7F) are  encoded  literally,
37                   except that ASCII letters are forced to uppercase or lower‐
38                   case  according  to  the  corresponding  case  flags.    If
39                   case_flags is a NULL pointer then ASCII letters are left as
40                   they are, and other code points are treated as unflagged.
41
42       size_t * output_length
43                   The caller passes in  the  maximum  number  of  ASCII  code
44                   points  that  it can receive.  On successful return it will
45                   contain the number of ASCII code points actually output.
46
47       char [] output
48                   An array of ASCII code points.   It  is  *not*  null-termi‐
49                   nated;  it will contain zeros if and only if the input con‐
50                   tains zeros.  (Of course the caller can leave  room  for  a
51                   terminator and add one if needed.)
52

DESCRIPTION

54       Converts a sequence of code points (presumed to be Unicode code points)
55       to Punycode.
56

RETURN VALUE

58       The return value can be any of the Punycode_status values defined above
59       except  PUNYCODE_BAD_INPUT.   If not PUNYCODE_SUCCESS, then output_size
60       and output might contain garbage.
61

REPORTING BUGS

63       Report  bugs  to   <bug-libidn@gnu.org>.    GNU   Libidn   home   page:
64       http://www.gnu.org/software/libidn/  General  help  using GNU software:
65       http://www.gnu.org/gethelp/
66
68       Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010  Simon
69       Josefsson.
70       Copying  and  distribution  of this file, with or without modification,
71       are permitted in any medium  without  royalty  provided  the  copyright
72       notice and this notice are preserved.
73

SEE ALSO

75       The  full  documentation  for libidn is maintained as a Texinfo manual.
76       If the info and libidn programs are properly installed  at  your  site,
77       the command
78
79              info libidn
80
81       should give you access to the complete manual.
82
83
84
85libidn                               1.18                   punycode_encode(3)
Impressum