idn2_to_ascii_4i2(3)
π idn2_to_ascii_4i2 β a libidn2 moment π
okay bestie, sit down, hydrate, and let me tell you about idn2_to_ascii_4i2(3) from the libidn2 family. she's an API function, she converts your Unicode into ASCII, and she is literally the moment. π
β¨ SYNOPSIS β¨
#include <idn2.h>
int idn2_to_ascii_4i2(const uint32_t * input, size_t inlen, char **
output, int flags);
look at her. iconic signature. no notes. π
π¦ ARGUMENTS π¦
const uint32_t * inputβ your zero terminated input Unicode (UCS-4) string. that's her. that's the girl. πsize_t inlenβ how many elements are ininput. count them, bestie, she needs the number. π’char ** outputβ a pointer to the newly allocated zero-terminated output string. she's gonna hand you a whole new string, freshly allocated, main character energy. β¨int flagsβ optionalidn2_flagsto modify behaviour. yes queen, customize your experience. π
πΈ DESCRIPTION πΈ
so. the ToASCII operation takes a sequence of Unicode code points that make up one domain label and transforms it into a sequence of code points in the ASCII range (0..7F). and if ToASCII succeeds? the original sequence and the resulting sequence are equivalent labels. they're the same girl in different outfits. π«Ά
β οΈ it's important to note that the ToASCII operation can fail. ToASCII fails if any step of it fails. if any step of the ToASCII operation fails on any label in a domain name, that domain name MUST NOT be used as an internationalized domain name. and the method for dealing with this failure is application-specific. no cap. π
the inputs to ToASCII are a sequence of code points. that's it, that's the tea. π
ToASCII never alters a sequence of code points that are all in the ASCII range to begin with (although it could fail, bestie, she's complicated). and applying the ToASCII operation multiple times has the same effect as applying it just once. it's giving idempotent. slay. π
the default behavior of this function (when flags are zero) is to apply the IDNA2008 rules without the TR46 amendments. but listen β as the TR46 non-transitional processing is nowadays ubiquitous, when you're unsure, it is recommended to call this function with the IDN2_NONTRANSITIONAL and the IDN2_NFC_INPUT flags for compatibility with other software. do it for the plot. do it for the interoperability. do it for me. π
π RETURNS π
on successful conversion, IDN2_OK is returned. π
if the output label would have been too long, IDN2_TOO_BIG_LABEL is returned. she said "too much, even for me". π
or, you know, another error code is returned. sometimes it's just not that girl's day. π
β SINCE β
2.1.1 β a classic, an OG, a legend in the game. β¨
π REPORTING BUGS π
found a bug? first of all, periodt. report it to <help-libidn@gnu.org>. π§
general guidelines for reporting bugs: https://www.gnu.org/gethelp/
libidn2 home page: https://www.gnu.org/software/libidn2/
π COPYRIGHT π
Copyright Β© 2002-2025 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. so go forth and share, bestie. π«Ά
π SEE ALSO π
the full documentation for libidn2 is maintained as a Texinfo manual. if the info and libidn2 programs are properly installed at your site, the command
info libidn2
should give you access to the complete manual. as an alternative you may obtain the manual from:
https://www.gnu.org/software/libidn/libidn2/manual/
and that's the whole page, bestie. this was idn2_to_ascii_4i2(3) from libidn2 2.3.8 β go read your man pages, stay hydrated, and remember: ToASCII never alters an all-ASCII sequence, and neither should you. π§π mwah.
π¦ where this page comes from
- alpine 3.23: libidn2-doc 2.3.8-r0 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- alpine 3.24: libidn2-doc 2.3.8-r0 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- arch rolling: libidn2 2.3.8-1 Β· GPL2 AND LGPL3
- debian trixie: libidn2-dev 2.3.8-2 Β· GPL-3.0-or-later
- fedora 43: libidn2-devel 2.3.8-2.fc43 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 43: libidn2-devel 2.3.8-2.fc43 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 44: libidn2-devel 2.3.8-3.fc44 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 44: libidn2-devel 2.3.8-3.fc44 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- ubuntu questing: libidn2-dev 2.3.8-4
- ubuntu resolute: libidn2-dev 2.3.8-4build1 Β· GPL-3.0-or-later
- ubuntu stonking: libidn2-dev 2.3.8-5 Β· 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