punycode_encode(3)
π punycode_encode(3) π
okay bestie, gather round, we're doing a libidn moment β this one's punycode_encode, and she is literally the girl who turns your code points into Punycode. no cap. β¨
β¨ NAME β¨
punycode_encode β API function π
πΈ SYNOPSIS πΈ
#include <punycode.h>
int punycode_encode(size_t input_length, const punycode_uint [] input,
const unsigned char [] case_flags, size_t * output_length, char []
output);
π ARGUMENTS π
size_t input_lengthβ the number of code points hanging out in the input array, and also the number of flags in the case_flags array. same number, two jobs, multitasking queen πconst punycode_uint [] inputβ an array of code points. they're presumed to be Unicode code points, but ngl that is not strictly REQUIRED. important distinction, bestie: this array holds code points, not code units. UTF-16 uses code unitsD800throughDFFFto refer to code points10000..10FFFF. the code pointsD800..DFFFdo not occur in any valid Unicode string. and the code points that can occur in Unicode strings (0..D7FFandE000..10FFFF) are also called Unicode scalar values. so that's the lore π¦const unsigned char [] case_flagsβ either aNULLpointer or an array of boolean values that runs parallel to the input array. nonzero (true, flagged) suggests the corresponding Unicode character get forced to uppercase after being decoded (if possible), and zero (false, unflagged) suggests it get forced to lowercase (if possible). ASCII code points (0..7F) are encoded literally, except ASCII letters get forced uppercase or lowercase according to the corresponding case flags. if case_flags is aNULLpointer then ASCII letters are left exactly as they are, and other code points are treated as unflagged. so basically the flags are the outfit change, andNULLis "we're going out in what we're wearing" πsize_t * output_lengthβ the caller passes in the maximum number of ASCII code points it can receive. on successful return it will contain the number of ASCII code points actually output. it's giving "capacity in, reality out" πchar [] outputβ an array of ASCII code points. it is *not* null-terminated; it will contain zeros if and only if the input contains zeros. (of course the caller can leave room for a terminator and add one if needed β thoughtful king behavior π«Ά)
π₯ DESCRIPTION π₯
Converts a sequence of code points (presumed to be Unicode code points) to Punycode. that's the whole gig. she eats code points, she serves Punycode π
Return value: the return value can be any of the Punycode_status values defined above except PUNYCODE_BAD_INPUT.
π¨ bestie listen β if it's notPUNYCODE_SUCCESS, thenoutput_sizeandoutputmight contain garbage. literally garbage. do not trust them. do not pass go. π
π DESCRIPTION π
(okay so the manual says it twice and honestly? she said it twice because it matters, periodt)
Converts a sequence of code points (presumed to be Unicode code points) to Punycode.
Return value: 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.
π REPORTING BUGS π
- Report bugs to
<help-libidn@gnu.org>. π¬ - General guidelines for reporting bugs:
https://www.gnu.org/gethelp/ - GNU Libidn home page:
https://www.gnu.org/software/libidn/
π COPYRIGHT π
Copyright Β© 2002-2026 Simon Josefsson.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. iconic, legally speaking π
π¦ SEE ALSO π¦
The full documentation for libidn is maintained as a Texinfo manual. If the info and libidn programs are properly installed at your site, the command
info libidn
should give you access to the complete manual. As an alternative you may obtain the manual from:
https://www.gnu.org/software/libidn/manual/
and that's the whole page, bestie!! this is from libidn, version 1.44, and yeah the footer is just punycode_encode(3) again because the manpage header and footer are doing their little matching-couple thing πΈβ¨ mwah, go encode something cute π
π
π¦ where this page comes from
- arch rolling: libidn 1.44-1 Β· GPL3 AND LGPL
- epel 10: libidn-devel 1.44-1.el10_3 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: libidn-devel 1.44-1.fc43 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 43: libidn-devel 1.44-1.fc43 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: libidn-devel 1.44-1.fc44 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- fedora 44: libidn-devel 1.44-1.fc44 Β· (LGPL-3.0-or-later OR GPL-2.0-or-later) AND GPL-3.0-or-later AND GFDL-1.3-or-later
- ubuntu stonking: libidn-dev 1.44-1 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms