idn2_lookup_u8(3)
π idn2_lookup_u8 β a.k.a. the libidn2 API function π
okay bestie, sit DOWN, because this one is literally the main character of IDNA2008 lookups. it's <cyan>idn2_lookup_u8</cyan> from the libidn2 manual, and yes, she ate. π
β¨ SYNOPSIS β¨
#include <idn2.h>
int idn2_lookup_u8(const uint8_t * src, uint8_t ** lookupname, int
flags);
that's it, that's the whole vibe. one function, three little arguments, infinite slay. π
π ARGUMENTS π
const uint8_t * srcβ your input, bestie! it's a zero-terminated UTF-8 string, and it must be in Unicode NFC normalized form. no cap, if it's not NFC you're gonna have a bad time. πuint8_t ** lookupnameβ the output variable, freshly allocated by the function, holding the name you're gonna look up in DNS. so it's giving "here's your glow-up result" energy. πint flagsβ optionalidn2_flagsto modify the behaviour. this is where you customize the whole situation. π¦
π DESCRIPTION π
So what does she actually do? She performs the IDNA2008 lookup string conversion on the domain name src, exactly as described in section 5 of RFC 5891. iconic behavior, honestly. πβ¨
heads up bestie: the input string must be encoded in UTF-8 and be in Unicode NFC form. both. no exceptions. that's the vibe check.
Pass IDN2_NFC_INPUT in flags to convert the input to NFC form before further processing. and listen β IDN2_TRANSITIONAL and IDN2_NONTRANSITIONAL already imply IDN2_NFC_INPUT, so no need to double up, she's got you. π«Ά
Pass IDN2_ALABEL_ROUNDTRIP in flags to convert any input A-labels to U-labels and perform additional testing. and get this β this is default since version 2.2. to switch this behavior off, you pass IDN2_NO_ALABEL_ROUNDTRIP. yes, it's the "not me flipping the default" situation. π
Pass IDN2_TRANSITIONAL to enable Unicode TR46 transitional processing, and IDN2_NONTRANSITIONAL to enable Unicode TR46 non-transitional processing. pick your fighter. π₯
Multiple flags may be specified by binary or:ing them together. stack 'em like bracelets. πΈ
After version 2.0.3: IDN2_USE_STD3_ASCII_RULES is disabled by default. previously we were eliminating non-STD3 characters from domain strings such as _443._tcp.example.com, or IPs like 1.2.3.4/24 provided to libidn2 functions. that was an unexpected regression for applications switching from libidn, and thus it is no longer applied by default. π€ Use IDN2_USE_STD3_ASCII_RULES to enable that behavior again, if that's your thing.
After version 0.11: lookupname may be NULL to test lookup of src without allocating memory. a little dry-run moment, we love to see it. π§
β RETURNS β
On successful conversion, IDN2_OK is returned. π
If the output domain or any label would have been too long, IDN2_TOO_BIG_DOMAIN or IDN2_TOO_BIG_LABEL is returned β she's too big to fit, it's giving oversized luggage at the airport. π§³
Or, you know, another error code is returned. just read the error, bestie. π
π¦ SINCE π¦
0.1 β she's been here since the beginning. a true OG. π
π REPORTING BUGS π
Found a bug? don't gatekeep, report it to <help-libidn@gnu.org>. π§
General guidelines for reporting bugs live at: 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. periodt. π
π₯ 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. iykyk. πβ¨
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 libidn2 version 2.3.8, and yeah, we're deep in the idn2_lookup_u8(3) era. go forth and normalize those strings. 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